Rounding an exactly representable dyadic is the identity #
For a descriptor with fmt.isIEEE = true, a dyadic m * 2^e whose significand fits in the
precision, whose exponent is at least the minimum subnormal exponent, and whose magnitude is at
most the largest finite value is exactly representable. Rounding it in any of the four IEEE
directions therefore returns a finite value with exactly the same real denotation.
roundDyadicWithRounding_of_representable is the statement used by IEEE remainder (whose exact
result is always representable) and by roundToIntegral (whose rounded integer is always
representable for every IEEE interchange format). The finite decoded value of any word satisfies
the three hypotheses; see toDyadic?_significand_lt and minSubnormalExponent_le_toDyadic?.
Bounds satisfied by every decoded finite value #
The decoded dyadic of a word has a significand below 2^(fracWidth + 1) and an exponent no smaller
than the minimum subnormal exponent. These bounds describe the format's precision and exponent grid.
The decoded significand of a word fits in the format's precision.
The decoded exponent of a word is at least the minimum subnormal exponent.
Membership in the format grid #
A dyadic belongs to the gradual-underflow grid when its significand is m * 2^k with m below
2^(fracWidth + 1) and its exponent is at least the minimum subnormal exponent. The scaled form
is what roundToIntegral produces when the input already has a nonnegative exponent, so the
trailing zero bits must be allowed here. Dyadic.genericFormat_of_significand_lt is the unscaled
special case.
A dyadic whose significand fits in the precision and whose exponent is at least the minimum subnormal exponent belongs to the descriptor's Flocq grid. No magnitude bound is needed because the grid has no upper exponent limit.
The exact value of the largest finite word, as a dyadic, denotes the same real.
The leading binary exponent of a nonzero dyadic within the largest finite magnitude does not exceed the largest normal exponent.
Normalizing a significand of the form m * 2^k with m in precision never carries into the next
binade: the shift discards only zero bits or the value already fits.
Exact rounding, one direction at a time #
Nearest-even rounding of a representable dyadic returns a finite word with the same real value.
Downward rounding of a representable positive magnitude is exact and finite.
Upward rounding of a representable positive magnitude is exact and finite.
Every IEEE rounding direction fixes an exactly representable dyadic: the result is finite and its
real value is the dyadic's own value. The significand may carry trailing zero bits beyond the
precision, as m * 2^k.
Every IEEE rounding direction fixes an exactly representable dyadic whose significand fits in the precision: the result is finite and its real value is the dyadic's own value.
Overflow classification of representable dyadics #
No rounding direction classifies a dyadic within the largest finite magnitude as overflowing.
Together with roundDyadicWithRounding_of_representable, this clears the overflow indicator of
dyadicRoundingStatus for exactly representable results.