Expand description
The round-number families: the powers, Fibonacci steps, and
nearest-pick the floor_*, ceiling_*, and closest_* nodes and
their native lowerings compute with.
Functions§
- ceiling_
fibonacci_ val - Smallest Fibonacci number (
1, 2, 3, 5, 8, …) that is>= x;1.0forx <= 1. Assumespositive_finite(x). - floor_
fibonacci_ val - Largest Fibonacci number (
1, 2, 3, 5, 8, …) that is<= x, or0.0whenx < 1(nothing in the sequence is that small). Assumes finitex. - floor_
pow2 - Largest power of two
2^n <= x. Assumespositive_finite(x). - floor_
pow10 - Largest power of ten
10^n <= x. Assumespositive_finite(x). - pick_
closest - Pick whichever of
lo/hiis nearer toxby absolute distance. Ties resolve tolo(the floor), per theclosest_*contract. - positive_
finite - True only for a strictly-positive, finite
x. All family selectors gate on this and return0.0otherwise, sox <= 0,NaN, and±infall fold to the zero magnitude without special-casing each node.