Executable exact fixed-point operations #
Same-scale addition, negation, and subtraction are exact. Multiplication composes the two scales in its result type rather than silently selecting a rounding policy.
Integer denominator of the configured fixed-point grid.
Instances For
Wrap a complete fixed-point code without conversion.
Instances For
Recover the complete fixed-point code without conversion.
Instances For
Construct a value from its exact stored integer coefficient.
Instances For
Round an exact rational once to the nearest fixed-point grid value, breaking ties to even.
This is the construction policy used by decimal and scientific literals. It never converts through a host floating-point value.
Instances For
Recover the exact stored integer coefficient.
Instances For
Decode a configured fixed-point value to its exact rational meaning.
Instances For
Exact same-scale addition.
Instances For
Exact additive inverse at the same scale.
Instances For
Exact same-scale subtraction.
Instances For
Exact multiplication with the composed output scale visible in the result type.