TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.BID.Runtime

Binary integer decimal encoding #

IEEE 754-2019 §3.5.2(c)(2) stores the decimal coefficient as a binary integer. The 11 steering bits move the exponent field and imply coefficient prefix 100. A finite coefficient exceeding 10^precision - 1 denotes zero, preserving its sign and quantum exponent. Excessive NaN payloads also denote zero. The decoder implements these rules rather than reducing the coefficient modulo a decimal power.

Encode a finite coefficient and biased exponent using the BID steering bits.

Instances For

    Read the BID coefficient before checking its decimal precision bound.

    Instances For

      Read the biased exponent; subtracting the steering prefix exposes its field.

      Instances For

        Decode finite fields. Oversized binary coefficients denote decimal zero.

        Instances For

          A NaN payload outside the decimal payload range denotes zero (§3.5.2(a), (c)(2)).

          Instances For

            The complete BID interchange codec. Its laws are proved in BID.Proof.

            Instances For

              Decode a BID word at the selected interchange layout.

              Instances For

                Encode a representable datum as BID, returning none instead of rounding when the selected width cannot represent it.

                Instances For

                  Canonical BID encoding of the datum denoted by a word.

                  Instances For