DEC64
(Changed primary category) |
(Category:Floating point data types) |
||
Line 12: | Line 12: | ||
[[Category:Binary Data]] | [[Category:Binary Data]] | ||
+ | [[Category:Floating point data types]] |
Revision as of 16:25, 6 July 2017
DEC64 is a scheme to encode floating point numbers as a 56-bit coefficient and an 8-bit exponent, both expressed in two's complement binary form, with the exponent in the least-significant 8 bits of the 64-bit block. This is a "decimal" rather than a "binary" format because the exponent is in powers of ten rather than powers of two, though the exponent and coefficient are expressed as binary numbers. Because a decimal exponent is used, the format precisely expresses decimal fractions without the roundoff errors found in binary-exponent formats, making it useful for financial data.
Integers may be expressed in DEC64 using an exponent of zero, allowing them to be processed using high-efficiency binary integer arithmetic operators. Any pair of numbers using the same exponent can be similarly processed with simple arithmetic without needing to act on the exponent. Rather than normalizing the exponential format as is common in other exponent-based formats, it is encouraged to use exponents that allow for such simple processing where appropriate, such as using zero exponents on all integer values within the allowed range.