TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Transcendentals.Enclosure.Runtime

Binary rounding of rational enclosures #

Exact rational rounding accepts an enclosure when both endpoints select the same finite IEEE encoding. The endpoints are compared as encodings, so they must also agree on the sign of zero. The proofs show that an accepted result is finite and has the real value of the correctly rounded exact value, but they do not state which sign a zero result carries. An inconclusive enclosure returns none for refinement.

An enclosure may also carry a binary scale: roundScaled? fmt interval scale rounds the endpoints of interval times 2 ^ scale without forming that power, so a result far outside the range of the interval's rationals costs no more than one near one.

Round a signed rational times 2 ^ scale, taking its sign from the exact value.

Instances For

    Return a finite encoding only when both endpoints of interval times 2 ^ scale select it by nearest-even rational rounding.

    Unsupported descriptors, overflowing endpoints, and differing endpoint results return none.

    Instances For

      Return a finite encoding only when both endpoints select it by nearest-even rounding.

      Instances For