TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.DPD.Runtime

Densely packed decimal interchange encoding #

IEEE 754-2019 §3.5.2(c)(1) combines the leading decimal digit and the high exponent bits in a five-bit combination field. The remaining digits use Cowlishaw declets. All redundant declets decode; encoding chooses the canonical representation.

Combine a leading digit with the high two exponent bits.

Instances For

    Leading digit extracted from a finite combination field (field < 30).

    Instances For

      High exponent bits extracted from a finite combination field.

      Instances For

        Assemble the leading digit, biased exponent, and already-packed trailing declets.

        Instances For

          Encode a finite decimal coefficient and biased exponent.

          Instances For

            Decode a finite word, accepting every trailing declet.

            Instances For

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

              Instances For

                Decode a DPD word at the selected interchange layout, including redundant declets.

                Instances For

                  Encode a datum exactly as DPD, rejecting unrepresentable inputs without rounding.

                  Instances For

                    Replace redundant declets and unused special bits by their canonical encodings.

                    Instances For