Exactness of shared native signed-magnitude arithmetic #
The format-independent UInt64 signed-magnitude primitive implements exact dyadic addition
under its capacity hypotheses. Equal signs require a no-overflow hypothesis; opposite signs
reduce to an exact difference. The two-limb refinement is in SignedMagnitude.UInt128.Proof.
Interpret a native signed magnitude as the canonical exact dyadic used after addition.
Exact cancellation is normalized to positive zero with exponent zero. Nonzero results retain the common exponent at which their magnitudes were added.
Instances For
A zero magnitude returned by native signed-magnitude addition always has a positive sign.
The no-overflow premise rules out a wrapped same-sign sum. With nonzero inputs, the remaining zero case is exact cancellation of opposite, equal magnitudes.
Native signed-magnitude addition denotes exact dyadic addition at a common exponent.
The only capacity hypothesis is required by same-sign addition. Opposite-sign subtraction cannot overflow, while the nonzero hypotheses exclude the input-zero branches handled directly by format-specific kernels.