TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.Sqrt.GridProof

Correct rounding of the square-root coefficient #

The integer square root brackets the mathematical real square root. Exact squared comparisons then give at most half-unit error in either nearest mode and the appropriate one-sided bounds in the three directed modes.

Integer squares yield their exact nonnegative roots in all five rounding modes.

The square of an exact half-integer lies between the same two integer squares.

All five modes return a root less than one integer grid unit from the exact root.

The exact square test determines which side of the real midpoint contains the root.