s 11111 1x...x a signalling NaN
ecec
=== Densely packed decimal significand field ===
In this version, the significand is stored as a series of decimal digits. The leading digit is between
0 and 9 (3 or 4 binary bits), and the rest of the significand uses the [[densely packed decimal]]
Unlike the binary integer significand version, where the exponent changed position and came before the significand, this encoding combines the leading 2 bits of the exponent and the leading digit (3 or 4 bits)
of the significand into the five bits that follow the sign bit.
This eight bits after that are the exponent continuation field, providing the less-significant bits of the exponent.
The last 50 bits are the significand continuation field, consisting of 5 10-bit "declets".
Each declet encodes three decimal digits using the DPD encoding.
If the first two bits after the sign bit are "00", "01", or "10", then those are
the leading bits of the exponent, and the three bits after that are interpreted as
the leading decimal digit (0 to 7):
s 00 TTT (00)eeeeeeee (0TTT)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 01 TTT (01)eeeeeeee (0TTT)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 10 TTT (10)eeeeeeee (0TTT)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
If the 4 bits after the sign bit are "1100", "1101", or "1110", then the
second two bits are the leading bits of the exponent, and the last bit is
prefixed with "100" to form the leading decimal digit (8 or 9):
s 1100 T (00)eeeeeeee (100T)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 1101 T (01)eeeeeeee (100T)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 1110 T (10)eeeeeeee (100T)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
The remaining two combinations (11110 and 11111) of the 5-bit field
are used to represent ±infinity and NaNs, respectively.
The DPD/3BCD transcoding for the declets is given by the following table.
b9...b0 are the bits of the DPD, and d2...d0 are the three BCD digits.
{{Densely packed decimal}}
The 8 decimal values whose digits are all 8s or 9s have four codings each.
The bits marked x in the table above are ignored on input, but will always be 0 in computed results.
(The 8×3 = 24 non-standard encodings fill in the gap between 10<sup>3</sup>=1000 and 2<sup>10</sup>=1024.)
In the above cases, with the ''true significand'' as the sequence of decimal digits decoded, the value represented is
:<math>(-1)^\text{signbit}\times 10^{\text{exponentbits}_2-398_{10}}\times \text{truesignificand}_{10}</math>
== See also ==
|