Decimal exponent clamping preserves binary conversion #
convertDecimalText clamps a decimal exponent outside the format's range before forming the exact
rational. Far above the overflow threshold every rational rounds to the same overflow result with
the same flags, and far below the least subnormal every positive rational rounds to the same tiny
result with the same flags. In both regions every finite value lies on the same side of the
rational, so the ternary value is preserved too. This file proves these saturation facts for
scaled rationals and concludes convertDecimalText_eq_exact.
Saturated rounding values #
Above decimalSaturationHigh, the rounded value does not depend on the exact rational.
Below decimalSaturationLow, the rounded value does not depend on the exact rational.
Saturated status classification #
Above decimalSaturationHigh, every rounding direction reports overflow.
Below decimalSaturationLow, no rounding direction reports overflow.
Below decimalSaturationLow, every result is tiny after rounding.
Below decimalSaturationLow, a positive rational never equals a finite result.
Above decimalSaturationHigh, the status does not depend on the exact rational.
Below decimalSaturationLow, the status does not depend on the exact rational.
Saturated ternary values #
Above decimalSaturationHigh, the ternary value does not depend on the exact rational.
Every finite value lies below 2^(maxNormalExponent + 1) in magnitude, so a finite delivery is
on the same side of both rationals. A non-finite delivery compares by the sign alone.
Below decimalSaturationLow, the ternary value does not depend on the exact rational.
Both rationals lie strictly between zero and the least positive subnormal in magnitude, so every finite delivery, zero included, is on the same side of both. A non-finite delivery compares by the sign alone.
Decimal magnitudes #
The clamp preserves every outcome #
Clamping the decimal exponent never changes the value, status, or ternary value of a binary conversion.
Outside the clamp range the exact rational is either above every overflow threshold or below every underflow threshold, and the rounded value, flags, and ternary value depend only on that side.
The fast decimal conversion agrees with the exact reference conversion on every input.