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 six directions
therefore returns a finite value with the same real denotation, and such a value is never a grid
tie (dyadicIsGridTie_eq_false_of_eq_mul_pow2).
Internal.Directed.roundDyadic_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, by 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.
A finite word's exponent field is at most maxFiniteExpField. An IEEE encoding reserves the
all-ones field for infinities and NaNs, and the other encodings use every field for finite values.
Every decoded finite value lies strictly below 2^(maxNormalExponent + 1) in magnitude, whatever
the descriptor's encoding.
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.
A representable dyadic is never a grid tie: every bit below its grid spacing is clear, so the discarded bits are never one half of a unit.
Downward rounding of a representable positive magnitude is exact and finite.
Upward rounding of a representable positive magnitude is exact and finite.
Every 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 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 Internal.Directed.roundDyadic_of_representable, this clears the overflow
indicator of dyadicRoundingStatus for exactly representable results.
Exact reconstruction of finite representations #
A nonzero decoded dyadic already uses the format's canonical exponent.
Equal nonzero numerical values have the same canonical decoded exponent.
A dyadic denotes zero exactly when its unsigned coefficient is zero.
In a conventional IEEE format, rounding a decoded nonzero value restores its word.
In a conventional IEEE format, rounding an exact zero preserves its sign.
In a conventional IEEE format, rounding a decoded finite dyadic restores its complete word.