Decimal64 floating-point format: Difference between revisions

Content deleted Content added
Keka (talk | contribs)
Keka (talk | contribs)
Representation of decimal64 values: adding text on the DPD alternative
Line 13:
for instance in a situation where decimal64 values are communicated between systems.
 
OneIn one representation method is based onthe [[densely packed decimalsignificand]] for most of the
is represented as binary coded positive integer.
 
In theThe other, alternative, representation method theis based [[significand]]on
[[densely packed decimal]] for most of the
significand (except the most significant digit).
 
 
In the other representation method the [[significand]]
=== Binary integer significand field ===
is represented as binary coded positive integer.
This representation is explained in more detail here.
 
The position of the exponent and significand parts, as well as whether there
Line 78 ⟶ 81:
 
s 111111 x...x a signalling NaN
 
 
=== Densely packed decimal significand field ===
 
For the alternative using DPD encoding for most of the significand, the position
of the exponent part and significand parts do not move, but the implicit
lead bits of the exponent and the lead digit of the significand depend on
the five bits that follow the sign bit.
 
The last 50 bits are the significand field, consisting of 5 "declets".
A ''declet'' is 10 bits in DPD encoding, coding three decimal digits.
 
The eight bits before the significand field is the exponent field.
 
If the first two bits after the sign bit are "00", "01", or "10", then the
exponent field has those two bits as (semi)implicit lead bits.
The three bits after the "00", "01", or "10" bits are interpreted as
the lead decimal digit (0 to 7).
 
s 00 mmm (00)eeeeeeee (mmm)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 01 mmm (01)eeeeeeee (mmm)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 10 mmm (10)eeeeeeee (mmm)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
 
If the 4 bits after the sign bit are "1100", "1101", or "1110", then the
exponent field has last two bits of those four bits as (semi)implicit lead bits.
The bit just before the exponent field is prefixed with "100" and is
interpreted as the lead digit for the significand (8 or 9).
 
s 1100 m (00)eeeeeeee (100m)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 1101 m (01)eeeeeeee (100m)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
s 1110 m (10)eeeeeeee (100m)[tttttttttt][tttttttttt][tttttttttt][tttttttttt][tttttttttt]
 
The declets of the significand field are interpreted according to the
DPD encoding into 3 decimal digits per declet, following the lead decimal digit.
24 of the declet bit combinations are ill-formed, in which case the
significand is in error, but the declet is still interpreted as
coding a three-digit decimal sequence.
 
The encoding for the infinities and NaNs are the same for both alternative encodings.
 
== See also ==