Skip to main content

Module float

Module float 

Source
Expand description

Floating-point utilities beyond the standard library surface: accurate expm1/log1p, exact summation, isclose, and the classic frexp/ldexp/modf/nextafter decomposition functions.

expm1/log1p use hardware-accelerated std methods on standard builds and fall back to libm under no_std (when the libm feature is on).

Functions§

expm1
e^x - 1, accurate for small x (no catastrophic cancellation).
frexp
Split x into a mantissa m in [0.5, 1) (sign preserved) and an integer exponent e such that x == m * 2^e.
fsum
Exactly rounded sum of a slice (Neumaier compensated summation).
isclose
Approximate equality with relative and absolute tolerances.
ldexp
Construct x * 2^e, correctly handling subnormals and overflow.
log1p
ln(1 + x), accurate for small x.
modf
Split x into fractional and integral parts, both with x’s sign.
nextafter
Next representable f64 stepping from x toward y.