Fixed-point primitives for executable transcendental functions #
At scale n, the integer k represents k * 2^(-n). Multiplication and division round back
to that scale with ties to even. The scale is explicit so each format can choose its own working
precision. Approximation policy and constants live in Config.lean.
Number of fractional binary digits in a signed fixed-point representation.
An integer k at scale n represents k * 2^(-n).
Instances For
The fixed-point scale as an integer exponent.
Instances For
Integer power of two.
Instances For
The fixed-point encoding of one.
Instances For
Round an integer quotient to nearest, ties to even.
Callers provide a strictly positive denominator.
Instances For
Divide by a power of two, rounding to nearest with ties to even.
Instances For
Scale an integer by a signed power of two.
Negative shifts use nearest-even division.
Instances For
Fixed-point multiplication, rounded back to the context's scale.
Instances For
Fixed-point division by a positive denominator, rounded back to the context's scale.
Instances For
Divide a fixed-point value by a positive natural number.
Instances For
Round an exact dyadic to the context's scale, with ties to even.
Instances For
Convert a signed fixed-point integer to an exact dyadic.
Instances For
Evaluate descending fixed-point polynomial coefficients by Horner's method.
Each multiplication rounds back to the fixed-point scale. An empty coefficient list evaluates to zero.