Human-readable exact dyadic formatting #
Dyadics with normalized exponents in [-18, 18] are printed as exact decimals; the remaining
values use a significand times a power of two. This diagnostic notation limits expansion caused
by the exponent, while the printed significand can still be arbitrarily large. Formatting uses
integer arithmetic throughout.
Remove decimal zeroes that carry no information after the decimal point.
Instances For
Insert a decimal point places digits from the right.
Instances For
Format an exact dyadic without changing its value.
The decimal branch is deliberately bounded. An arbitrary static format may have an enormous exponent range, so attempting to materialize every exact decimal expansion would make inspecting one extreme value allocate an unreasonable string.