Exact-dyadic posit arithmetic #
Finite posit values are dyadic. These kernels therefore perform their exact intermediate work on integer significands and binary exponents rather than constructing normalized rational operands. Addition, subtraction, multiplication, division, square root, and fused multiply-add all round once according to the Posit Standard (2022).
The equality proofs against the independent rational specification live in Dyadic.Proof.
Exact integer addition followed by standardized posit rounding.
The dyadic operands are aligned at their smaller exponent and added as signed integers. Final threshold comparisons remain in the exact dyadic domain.
Instances For
Exact integer subtraction followed by standardized posit rounding.
Subtraction shares the exact dyadic alignment kernel with addition and performs no host floating-point computation.
Instances For
Exact integer multiplication followed by standardized posit rounding.
Compared with Model.Spec.mul, this forms one integer product and converts only that exact result
directly with the certified dyadic rounder; it allocates no rational operands.
Instances For
Correctly rounded division through exact dyadic cross-multiplication.
The kernel never constructs a rational quotient. Candidate values and rounding thresholds are multiplied by the positive divisor magnitude and compared directly with the dividend magnitude. Division by zero and every NaR case retain the specification's NaR result.
Instances For
Correctly rounded square root through exact dyadic squared comparisons.
The result itself may be irrational, so this kernel never constructs it. Candidate and threshold squares are compared directly with the decoded dyadic radicand.
Instances For
Exact fused multiply-add with one final standardized rounding.
Both multiplication and addition stay in the shared dyadic carrier. The exact result is converted directly after accumulating the addend, preserving the specification's single-rounding semantics.