benilla-re systems structs docs

Ld10Real

struct · crt · 10 bytes

Meaning
Holds an 80-bit real: the 64-bit mantissa with its leading 1 and the sign over a 15-bit exponent
Confidence
verified, proof one
Finding
crt/decimal#widening-a-double

Finding: Widening a double in crt: decimal digits

___dtold gives the 80-bit real of a double exactly: the sign, the exponent plus 0x3c00, and the 52 fraction bits shifted up 11 under an explicit leading 1. Exponent 0x7ff becomes 0x7fff, the fraction kept, so a NaN keeps its quiet bit as the mantissa's second bit. A subnormal takes exponent 0x3c01 with no leading 1 and is shifted up until its top bit is set, the exponent falling one per shift. Both zeros become all zero bits: the sign of -0 is dropped.

The derivation is in the doc.

Fields 2

offsetsizetypenamemeaningconfidencefinding
0x00008uint64_tmantissaHolds the 64-bit mantissaverified, proof onecrt/decimal#widening-a-double
0x00082uint16_texponentHolds the sign bit over the exponent biased by 0x3fffverified, proof onecrt/decimal#widening-a-double