Decimal interchange codecs and proofs #
The executable BID and DPD implementations satisfy exact datum round trips for
every Format descriptor, including decimal32, decimal64, and decimal128.
Every word decodes to a representable datum.
Canonicalization and conversion between encodings preserve that datum, including
cohort exponent, signed zero, infinity sign, and NaN sign, signaling bit, and payload.
The specifications are IEEE 754-2019 §§3.3, 3.5 and 5.5.2, Tables 3.3–3.4 and 3.6, and
Mike Cowlishaw's Densely Packed Decimal Encoding:
https://speleotrove.com/decimal/DPDecimal.html.
The IEEE standard is identified by DOI 10.1109/IEEESTD.2019.8766229.
These are representation guarantees. Import Arithmetic.Basic for decimal
arithmetic and its rounding, preferred-exponent, and exception theorems.
Both supported encodings satisfy the shared laws through their actual field codecs.
Re-encoding any decoded word succeeds and produces its canonical representative.
Conversion to the other encoding and back recovers the canonical source word. An originally redundant encoding need not be recovered bit for bit.