Skip to main content

Module nonfinite

Module nonfinite 

Source
Expand description

IEEE-754 non-finite propagation helpers for native BigFloat arithmetic.

Two entry points:

  • nonfinite_binop — used by the arithmetic operators (+, -, *, /, %). Handles both NaN/Inf propagation and non-finite generation (e.g. finite / 0 produces ±Inf; 0 / 0 or Inf - Inf produces NaN).
  • nonfinite_propagate — input-propagation subset only (no generation from finite inputs). Used by the checked methods (div_ref, sqrt_ref, …) so they keep their Err(DivByZero) / Err(Domain) contract on finite-domain errors while still propagating non-finite inputs.

§Rem special case

For Rem, when rhs is Infinite and lhs is finite, nonfinite_binop returns None — the caller should return lhs.clone() (IEEE rule: finite % Inf = finite).

Enums§

BinOp
Describes which binary operation is being performed.

Functions§

nonfinite_binop
IEEE-754 binary operation table for non-finite inputs or non-finite results generated from finite inputs (zero divisors).
nonfinite_propagate
Input-propagation subset only: propagates NaN/Inf inputs; does not generate Inf from finite-zero divisors (the caller keeps Err(DivByZero) for that case).