Nearest-away conversion to binary #
The rational is rounded to an integer on the destination binary grid. The rounded significand fits the precision, allowing one carry, so the binary encoder preserves its exact value whenever the delivered result is finite. This proves a single rounding, including ties away from zero, rather than assuming that two successive roundings agree.
The binary grid exponent is never below the subnormal quantum.
A positive magnitude scaled to its binary grid is below one full precision carry.
The nearest-away significand fits the precision, with equality allowed for a carry.
The nearest-away dyadic lies on the destination grid before imposing its upper exponent bound. A carry is an exact change of exponent, not another rounding.
Encoding the nearest-away dyadic preserves its exact real value on a finite result.
A finite nearest-away conversion is within half a binary grid unit of the input. The grid is clamped at the subnormal quantum.