4 ms·
It's unfortunate that Intel didn't consult Kahan earlier in the design process of the 8087, when they could have designed a base 10 floating point unit, as reco
by KMag 12y ago
It's unfortunate that Intel didn't consult Kahan earlier in the design process of the 8087, when they could have designed a base 10 floating point unit, as recommended by Kahan.
At least for spreadsheets and other accounting software, as well as most uses of JavaScript, IEEE 754-2008 decimal64 arithmetic is more appropriate than IEEE 754-1985 binary64 arithmetic. It astounds me how many professional programmers report bugs that aren't bugs but misunderstandings of binary floating point rounding. Excel has some ugly display hacks to hide some of the binary floating point number quirks from users, but this results in some numbers that display identically but are not equal according to the = operator.
Given the wide birth that programmers give to floating point number comparison and rounding, I wonder what would happen if a browser vendor shipped a dialect of ECMAScript/JavaScript that used decimal64s to implement Numbers. I haven't read the any of the ECMAScript standards in full, but I imagine this would be a non-conforming variation.
- pascal_cuoq 12y agoDo you have a source for “they could have designed a base 10 floating point unit, as recommended by Kahan”? It is not in the article being discussed (only one occurrence of “decimal”), and I have a hard time believing that Kahan didn't believe that binary was the superior base and should be implemented first (and is so efficient that it should be implemented even if one builds a decimal system too). Simulations of physical systems, for instance, do not care about the base. Base-2 offers the smoother relative precision, and a very simple system to save on the first digit (do not store it). In fact, I seem to remember a Kahan article saying that binary was superior to all other bases that could be considered for floating-point.
- KMag 12y agoSee the third citation in my reply to your sibling comment. Granted, personal exchange after an IEEE committee meeting is a weak citation, it is consistent with Kahan's email stating that he had tried to convince IBM to implement decimal floating point in hardware approximately 30 years prior to 2005 (my second citation to your sibling comment).
- pascal_cuoq 12y ago> Given the wide birth that programmers give to floating point number comparison and rounding, I wonder what would happen if a browser vendor shipped a dialect of ECMAScript/JavaScript that used decimal64s to implement Numbers. I haven't read the any of the ECMAScript standards in full, but I imagine this would be a non-conforming variation. You might be interested in this page: http://ftp.math.utah.edu/pub/mathcw/ http://ftp.math.utah.edu/pub/mathcw/ It did not make enough of a difference that the Ada, C++, C#, Fortran, Java, Pascal, mawk, nawk and lua variants with decimal floating-point were maintained since 2010, apparently.
- sharpneli 12y agoThe only benefit Base10 has over Base2 is that it's more easily understandable by beginners. It's more complex to implement in hardware. It still has exactly the same precision issues that must be taken into consideration. It still cannot represent everything exactly (1/3 in base 10 decimal. It gets truncated). Using base2 floating point is pretty much the same as using base2 integers.
- KMag 12y ago> The only benefit Base10 has over Base2 is that it's more easily understandable by beginners. Dr. William Kahan argues better than I can [1][2]. As far back as the 1970s, he tried to convince both Intel [3] and IBM [2] to implement base 10 floating point in hardware. First of all, in an ideal world, all software is written and reviewed by people have taken, aced, and remembered their discrete math courses. We don't live in that world. I work with a lot of bright people, but I've come to find that many of them have a model that's essentially floating point operations result in a value that's a low variance Gaussian distribution about the correct value. It's not uncommon for me to see things like doubles compared thusly: if (abs( floor(x) - floor(y) ) < 1e-30) ... Secondly, almost no financial or accounting rules or regulations are drafted by people with any knowledge of binary floating point semantics, so the semantics of IEEE 754-2008 decimal numbers more closely match financial rules and regulations. Thirdly, base 10 floating point numbers are less confusing for end users and result in fewer hacks such as the display hacks in Excel to prevent users from thinking floating point artifacts are bugs in Excel.[1] I think IEEE 754-1985 is a wonderful and well thought-out standard. However, the IEEE 754-2008 committee didn't add decimal floating points on a whim. There are very compelling use cases. [1] http://www.cs.berkeley.edu/~wkahan/ARITH_17.pdf [2] http://grouper.ieee.org/groups/754/email/msg01831.html (search for Yorktown Heights) [3] https://en.wikipedia.org/wiki/IEEE_754-1985#History Edit: It was a bit harsh to begin with "Incorrect." Sorry.