Commit Graph
1 Commits
Author SHA1 Message Date
waozi 1ffd317884 Add engineering functions with 1:1 gnumeric parity
- Base conversions via gnumeric's val_to_base: BASE, DECIMAL, BIN2HEX,
  BIN2OCT, OCT2BIN, OCT2HEX, HEX2BIN, HEX2OCT including 10-character
  limits, two's-complement rollover past base^10/2, and the 0x/h
  affixes accepted by BASE
- Bitwise operations from fn-numtheory: BITAND, BITOR, BITXOR,
  BITLSHIFT, BITRSHIFT with gnumeric's bit_max bound
- DELTA, GESTEP, ERFC (libm erfc, as gnumeric's double build),
  HEXREP (little-endian IEEE-754 byte hex, matching gnumeric 1.12),
  INVSUMINV
- Bessel functions: BESSELI/BESSELK are faithful ports of the R/Cody
  algorithms gnumeric uses outside its series domain; BESSELJ/BESSELY
  use jn/yn for integer orders. All fixture rows are bit-exact;
  isolated arguments differ from gnumeric by one ULP where gnumeric
  evaluates its double-double (GoQuad) series and phase algorithms.
- CONVERT: unit tables for weight, distance, time, pressure, force,
  energy, power, magnetism, liquid, information (with binary kibi
  prefixes), speed, and area, plus temperature conversions and the
  20 SI prefixes, with gnumeric's exact constant expressions

Number rendering now matches gnumeric's General format: positional
notation for 1e-4 <= |x| < 1e17, otherwise scientific with an
uppercase E and two-digit exponent (5E-324, 1E+17).

tests/fixtures/engineering_functions.gnumeric: 87 formulas, all
matching ssconvert; parity-test.sh green for 10 fixtures and
round-trips.
2026-09-05 04:26:09 -03:00