TorchLean API

FloatLib.Numerics.Quantization.Integer.Runtime

Integer destination ranges #

A range check follows exact rational-to-integer rounding. The caller supplies the integer rounder and the policy for failure, allowing IEEE invalid results and Posit integer sentinels to share the same numerical range calculation. Signed and unsigned words are instances of an inclusive integer interval.

An inclusive integer interval. Empty intervals are permitted and reject every result.

  • lower :

    Inclusive lower endpoint of the accepted integer interval.

  • upper :

    Inclusive upper endpoint; an endpoint below lower gives an empty interval.

Instances For

    Membership in the inclusive destination interval.

    Instances For
      @[instance_reducible]
      instance FloatLib.Numerics.instDecidableContains (range : IntegerRange) (value : ) :
      Decidable (range.Contains value)
      def FloatLib.Numerics.IntegerRange.round? (range : IntegerRange) (round : ) (value : ) :

      Round first, then test the resulting integer against the destination interval.

      Instances For

        Signedness and width specify the ordinary numerical range of a word. Reserved bit patterns are a separate format-specific conversion policy.

        • signed (width : ) : IntegerFormat

          Two's-complement numerical range, with width zero containing only zero.

        • unsigned (width : ) : IntegerFormat

          Unsigned numerical range from zero through 2 ^ width - 1.

        Instances For

          Smallest integer accepted by the word format.

          Instances For

            Largest integer accepted by the word format.

            Instances For

              Inclusive numerical range; width zero denotes only zero for either signedness.

              Instances For
                @[reducible, inline]

                Numerical representability, independently of any reserved bit pattern.

                Instances For