TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.DPD.DecletProof

Correctness of Cowlishaw's ten-bit declet table #

Encoding a value below 1000 produces a ten-bit declet whose decoding recovers all three decimal digits. Re-encoding a ten-bit pattern clears the ignored high bits precisely in the redundant cases.

The canonical encoding uses at most ten bits.

Every ten-bit pattern denotes three decimal digits.

The DPD table preserves all three input digits.

The only redundant declets have all three digits in {8, 9}. The canonical representative clears the two ignored high bits, as required by IEEE 754-2019 Tables 3.3–3.4; every other ten-bit pattern is already canonical.