Skip to main content

exact_binary64_sum_sign

Function exact_binary64_sum_sign 

Source
pub fn exact_binary64_sum_sign(
    values: impl IntoIterator<Item = f64>,
) -> Result<Ordering, ExactBinary64SumSignError>
Expand description

Exact sign of a finite binary64 sum, independent of order and cancellation.

Every input is decoded as an integer significand on the common 2^-1074 lattice. Positive and negative magnitudes accumulate into separate fixed 2,112-bit unsigned integers; comparing those integers returns the sign of the exact real sum, with no floating-point reduction and no tolerance.

At most 16,383 terms are admitted, the largest count whose worst-case carry is structurally contained by the fixed accumulator.