Source/Reference

Float32Model

reference/numeric/Float32Model.alpha

304 lines61 declarations17.2 KiBSHA-256 421f33839d13

def · lines 101–101

modelSumSigned

Full file
the exact signed sum of two FINITE values: same signs add the magnitudes, different signs subtract the smaller from the larger and take its sign (equal magnitudes give N = 0, which modelRoundBits makes the signed zero: +0 by the sign chosen below). Until 2026-09-22 the larger-first case took sign 0, so -3.0 + 1.0 gave +2.0 while 1.0 + -3.0 gave -2.0; the known-answer table had no such row. Found by the checked learning step's fused multiply-add, which shares the rule. Exact opposite-sign cancellation must choose +0 even when the first operand is negative. Preserving that operand's sign made -2+2 disagree with native round-to-nearest arithmetic; the singleton normalized- exponential pullback exposed it. Same-sign negative zeros stay negative.

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.