TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.DirectedSemantics.Rational.Conversion

Exact rational conversion for directed Model rounding #

Normalized mathlib Rat values round directly into any Model fmt. For conventional IEEE formats, directed overflow returns either a signed infinity or the largest finite value of the same sign, according to the rounding direction. The conversion theorems establish the extended-real lower bound for downward conversion and non-NaN results in both directions.

Round an exact rational according to an IEEE rounding direction.

Instances For

    Round an exact rational to nearest, ties to even.

    Instances For

      Round an exact rational toward negative infinity.

      Instances For

        Round an exact rational toward positive infinity.

        Instances For

          Downward conversion of an exact rational is an extended-real lower bound.

          Downward conversion of a normalized rational never produces NaN.

          Upward conversion of a normalized rational never produces NaN.