Integer square roots at the rounding scale #
Discarding twice as many radicand bits as root bits preserves the truncated root. One retained root bit and an exact square comparison recover the round and sticky bits without constructing the full root or shifting it one bit at a time.
@[inline]
Accuracy of an integer square root, from its exact nonnegative remainder.
Instances For
@[inline]
The integer square root after a right shift, retaining exact round and sticky bits.
Instances For
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.Model.ScaledSqrt.round
(spec : Float.Model.Format)
(sign : Float.Model.UnpackedFloat.Sign)
(radicand : ℕ)
(exponent : ℤ)
:
Round a scaled integer square root through the unpacked model's normalization rules.