Mixed-format P3109 arithmetic #
The source types select exact decoders; finite values are embedded into Rat. Thus a configured
IEEE accumulator, a P3109 operand, and an exact rational can occur in one expression. IEEE negative
zero loses its sign in this domain, as required by §4.8.1. Every exceptional observation becomes
the report's one NaN.
Destination supplies the final report projection. Destination.p3109 selects any P3109
descriptor. External destinations are provided separately, so importing this module installs no
alternative IEEE arithmetic or conversion instances. The operation always evaluates the whole
closed expression before projecting, including fused add-add and scaled arithmetic.
Reference: P3109 unapproved interim report 4.0.3, revision 34f5964, §§4.5, 4.8–4.10 and 5.8.
Canonicalize exceptions to the report's sole NaN datum.
Instances For
An explicit final report projection, kept separate from ordinary destination conversion.
- project : ProjectionPolicy → Numerics.NumericalValue ℚ → Result
Round, saturate, and encode one complete exact result under the supplied policy.
Instances For
A P3109 result format with its complete report projection policy.
Instances For
Decode through the source's exact interface and discard IEEE zero signs and NaN metadata.
Instances For
Conversion from an independently typed source through one destination projection.
Instances For
Apply a closed unary operation before the destination projection.
Instances For
Apply a closed binary operation to independently typed operands, then project once.
Instances For
Evaluate a complete ternary closed expression before the sole destination projection.
Instances For
Mixed reciprocal; zero maps to NaN before projection.
Instances For
Mixed addition, retaining closed-domain infinities and NaN.
Instances For
Mixed subtraction with no intermediate rounding.
Instances For
Mixed multiplication with no intermediate rounding.
Instances For
Mixed division with the report's zero-denominator rule.
Instances For
Mixed fused multiply-add, including an independently typed accumulator.
Instances For
Mixed fused add-add; neither addition is rounded before the result projection.
Instances For
Scaled binary operation from §5.8, with an implicit exact result scale of one.
Input scaling is closed multiplication: a zero scale times infinity is NaN, and a NaN scale propagates even when its element is zero. The complete scaled expression is projected once.
Instances For
Add two exactly scaled operands and project once.
Instances For
Subtract two exactly scaled operands and project once.
Instances For
Multiply two exactly scaled operands and project once.