In computing, decimal64 is a decimal floating-point computer numbering format that occupies 8 bytes (64 bits) in computer memory.
Decimal64 floating point is a relatively new decimal floating-point format, formally introduced in the 2008 version of IEEE 754.
Representation of decimal64 values
IEEE 754 allows two alternative representation methods for decimal64 values. The standard does not specify how to signify which representation is used, for instance in a situation where decimal64 values are communicated between systems.
One representation method is based on densely packed decimal for most of the significand (except the most significant digit).
In the other representation method the significand 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 is an implicit lead "100" bit triplet (see below) depends on the value of the bits following the sign bit (s below).
If the 2 bits after the sign bit are "00", "01", or "10", then the exponent field consists of the 10 bits following the sign bit, and the sigificand are the remaining 53 bits.
s 00eeeeeeee TTTtttttttttttttttttttt tttttttttttttttttttttttttttttt s 01eeeeeeee TTTtttttttttttttttttttt tttttttttttttttttttttttttttttt s 10eeeeeeee TTTtttttttttttttttttttt tttttttttttttttttttttttttttttt
This includes representation of subnormal numbers.
If the 4 bits after the sign bit are "1100", "1101", or "1110", then the exponent field consists of the 10 bits following the sign bit and the "11" bits thereafter, and the represented sigificand are in the remaining 51 bits. In this case there is an implicit (that is, not stored) "100" 3-bit sequence in the true significand.
s 11 00eeeeeeee (100)Ttttttttttttttttttttt tttttttttttttttttttttttttttttt s 11 01eeeeeeee (100)Ttttttttttttttttttttt tttttttttttttttttttttttttttttt s 11 10eeeeeeee (100)Ttttttttttttttttttttt tttttttttttttttttttttttttttttt
Note that the "11" 2-bit sequence after sign bit indicates that there is an implicit "100" 3-bit lead sequence in the true significand. Compare having an implicit 1 in the significand of normal values for the binary formats. Note also that the "00", "01", or "10" bits are part of the exponent field. Note also that zero (both positive and negative) have very many representation. Also other numbers, subnormal as well as normal, can have multiple representations. Trailing decimal zeroes can be shifted in or out, if possible without changing the value, while adjusting the exponent. This shifting is not a bitwise shift, but division/multiplication by ten.
The true significand is limited to
1017-1 = 9 999 999 999 999 999 = 100 011 100 001 101 111 001 001 101 111 110 000 001 111 111 111 111 1112
If the represented significand value, including the "100" implicit lead bits when the sign bit is followed by "11", is greater than that, then the significand is in error, but is to be interpreted as if it was 0 (including the implicit lead bits).
In the above cases, the value represented is
If the five bits after the sign bit are "11110" then the value is an infinity, (compare the extended real number line), with the sign indicated by the sign bit. The remaining 58 bits are ignored.
s 11110 x...x an infinity
If the six bits after the sign bit are 111110, the value is a quiet NaN. The sign bit and the remaining bits after this special sequence have no meaningful interpretation.
s 111110 x...x a quiet NaN
If the six bits after the sign bit are 111111, the value is a signalling NaN. The sign bit and the remaining bits after this special sequence have no meaningful interpretation.
s 111111 x...x a signalling NaN
See also
- IEEE Standard for Floating-Point Arithmetic (IEEE 754)
- ISO/IEC 10967, Language Independent Arithmetic
- Primitive data type