Skip to content

Numbers and Rounding ​

Excel does not return the raw IEEE 754 result of every calculation, and it does not round every result to the displayed decimal either. Each path below has its own rule, and Formulon follows each one.

Where a residue becomes zero ​

0.5-0.4-0.1 leaves about -2.78E-17 in binary floating point. Excel replaces that residue with 0 only in specific places:

FormulaExcelRule
=0.5-0.4-0.10At the outermost + or - of a cell formula, a result within eight units in the last place (ULPs) of zero, scaled by the left operand's binary exponent, becomes 0.
=(0.5-0.4-0.1)-2.7755575615628914E-17Parentheses around the expression remove the outermost-operation rule.
=0.5-0.4-0.1=0FALSEA comparison sees the raw result.
=SUM(0.5,-0.4,-0.1)0SUM, AVERAGE, SUBTOTAL and AGGREGATE apply the rule to the final addition only, scaled by the partial sum before it.
=SUMIF(A1:A3,"<>x") over the same three numbers-2.7755575615628914E-17SUMIF does not apply it.

Each row tests a separate path, so matching one does not establish the others. Snapping every intermediate addition instead of the last one changes the result of longer sums. Windows profiles also apply the measured Windows rounding rules to the arithmetic paths that differ from Mac Excel.

Digits, rounding and formats ​

  • Turning a number into text keeps 15 significant digits: =VALUETOTEXT(1234567890123456) is "1234567890123450".
  • Text-to-number conversion also keeps 15 significant digits, by truncation.
  • The ROUND family, ROUNDUP included, rounds from a 15-significant-digit decimal representation, so binary noise adds no unit: ROUNDUP(0.1+0.2,1) is 0.3.
  • MROUND works on the binary value rather than the decimal you typed: =MROUND(6.05,0.1) is 6.
  • A negative base takes an odd root but not every fractional power: =(-8)^(1/3) is -1.9999999999999998, while =(-8)^(2/3) is #NUM!.
  • Multiplication, ^ and POWER flush subnormal results (below the normal double range) to zero.
  • Number formats have their own rules: a fraction format's integer part takes the locale's group separator, a subnormal scientific exponent follows the integer placeholder count, and the 127-decimal cap is checked on the stored format.

Applying one decimal-rounding rule everywhere would change these results.

Checked against Excel

The Excel column was captured from a real Excel build. The Formulon column is what the WASM engine in this page returns for the same formula under the same profile.

Powered by the real Formulon engine (WASM) — it runs entirely in your browser, nothing is uploaded.

The last digits in the goldens ​

These committed Mac ja-JP goldens show why the last digits matter. Each case has effective absolute and relative tolerances of zero, at suite level or through a case override, and each golden records the Excel build, capture time, inputs and comparison settings. They are source regression cases, separate from the browser table above.

FormulaCaptured numeric resultWhat it checks
=NUMBERVALUE("9999999999999999")9999999999999990Text-to-number conversion truncates to Excel's significant-digit limit. Golden: integer_digits_truncated.
=ROUNDUP(2.675,2)2.6799999999999997The result can display as 2.68 while differing in its underlying double. Golden: round_digit_string_roundup_cents.
=ROUND(99.995,2)100Decimal rounding carries into the integer part. Golden: round_digit_string_round_carry.
=RATE(10,-100,1000)-1.963351707292562E-10The solver keeps Excel's small nonzero residual instead of an exact zero. Golden: rate_zero_outcome.
=NORM.DIST(17.947,-3.482,1.962,FALSE)2.538700187017102E-27A small nonzero distribution tail must not disappear under a loose absolute tolerance. Golden: norm_dist_pdf_far_tail.
=NORM.DIST(39,1,1,FALSE)0A separate case checks the tail that Excel flushes to zero. Golden: norm_dist_pdf_flushed.

Solvers and distributions ​

RATE, IRR, XIRR and YIELD follow Excel's solver behaviour, including starting guesses and failure conditions. Distribution tails and inverses, variance under cancellation, and regression with dependent columns exercise different numerical paths, which a simple payment or average never reaches. Inputs and comparison settings are recorded in the RATE / IRR, XIRR, YIELD and regression suites.

The same bits on every host ​

EXP, LN, LOG, LOG10, POWER, SIN, COS, TAN, SEC, CSC, COT, ASIN, ACOS, ATAN, ACOT and ATAN2 compute without the host math library and return the same bits on every host, so a native and a WASM build agree. The functions built on them use the same computation: the distributions and their inverses, the financial functions, LINEST, LOGEST, the IM* functions, and the engine's other internal exponentials, logarithms, powers and trigonometry.