This is a very naive question. If we look to the C and C++ standards committees, they are currently working on adding decimal floating point standard types:
So it seems that we will probably have a standardized decimal128
type while we do not yet have any standardized binary128
type (quad precision and not simply extended double precision). Is there a technical reason for this situation or is purely "political"?
Quad precision binary floating point is not a substitute for a decimal type. The precision problem is secondary to that of representation of decimal numbers. The idea is to add a type to the languages to support representation of numbers like 0.1
without any loss of precision - something you cannot do with a binary floating point type, no matter how high its precision may be.
That is why the discussion of adding a decimal type is orthogonal to the discussion about adding a quad precision data type: the two types serve different purposes, as discussed in one of the proposals that you linked:
Human computation and communication of numeric values almost always uses decimal arithmetic and decimal notations. Laboratory notes, scientific papers, legal documents, business reports and financial statements all record numeric values in decimal form. When numeric data are given to a program or are displayed to a user, binary to-and-from decimal conversion is required. There are inherent rounding errors involved in such conversions; decimal fractions cannot, in general, be represented exactly by binary floating-point values. These errors often cause usability and efficiency problems, depending on the application.
Here are a few simple reasons why there is work on decimal128
and not a binary floating point with 128 bits:
long double
is sufficiently vague and it seems unlikely that any of the vendors would accept changing its current meaning to use IEEE 754(2008) 128 bit semantics: it would change the behavior of roughly all implementations. I'd expect objections to mandating use of IEEE 754 for float
and double
, i.e., any IEEE 754 support for binary floating points would be something entirely new which someone would need to propose. I'd expect such a proposal to be somewhat controversial, e.g., with respect to what names to use and whether to actually add 128 bit support as most users will expect that it receives hardware support and the people working on hardware seem to have other priorities. Note that nobody expects (or should expect) hardware support for decimal floating points: although there is hardware support on Power7 and later processors, no other vendor is contemplating the idea.tl;dr: There is nothing political about decimal 128 bit formats being worked on and binary 128 bit formats not: there is a proposal for one and not the other and the proposer (me) has no interest to write proposals for both.
There is some work to support IEEE 754-2008 in ISO C, which means that binary128 (and more) may be standardized. See ISO/IEC JTC 1/SC 22/WG 14 N1789. C++ should follow, then.
Now, though binary128 is sometimes implemented, I doubt that it will be used in practice before some time since the current implementations are entirely in software (this may change, though), and there are faster and more flexible ways to get more accurate results: double-double arithmetic or similar ideas (e.g. floating-point expansions, which is more or less a generalization of double-double arithmetic).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With