Post Reply 
Toward an API for the real numbers
10-06-2020, 01:16 AM (This post was last modified: 03-07-2022 08:03 PM by robve.)
Post: #5
RE: Toward an API for the real numbers
(10-05-2020 07:24 PM)Wes Loewer Wrote:  
(10-05-2020 03:13 AM)robve Wrote:  Most calculators and spreadsheets are programmed with BCD instead of IEEE754

Can you give an example of a spreadsheet program that uses BCD? All the computer spreadsheets that I'm aware of use binary. Maybe I'm just not aware of the right ones.

SuperCalc initially used BCD but switched to binary. Also Microsoft Multiplan (later replaced by Excel) used BCD. Newer spreadsheet software does not, at least I am not aware of any. Obviously the battle for "sheet speed" was won by binary floating point, especially with the arrival of math coprocessors and later with CPUs supporting IEEE754 floating point operations. In the (distant) past, floating point was done in software, so perhaps the overhead of BCD wasn't a significant factor to consider anyway. But BCD did produce accurate decimals that were especially important for financial calculations. One dollar and cent is exactly $1.01, not some number close to $1.01. Imagine repeatedly adding $0.01 in a loop (or a recursive spreadsheet cell formula) in which the error accumulates. Before the arrival of IEEE754, floating point representations and operations were not as well designed, producing artifacts and roundoff errors. Dealing with that was tricky, so BCD was deemed safer. That's changed with the IEEE754 standard that's carefully designed. William Kahan, the “father” of IEEE-754 floating point, said in 1998:
"My reasoning was based on the requirements of a mass market: A lot of code involving a little floating-point will be written by many people who have never attended my (nor anyone else's) numerical analysis classes. We had to enhance the likelihood that their programs would get correct results. At the same time we had to ensure that people who really are expert in floating-point could write portable software and prove that it worked, since so many of us would have to rely upon it. There were a lot of almost conflicting requirements on the way to a balanced design."

PS. (edit) interesting fact: the Sharp Wizard 3D spreadsheet cards IQ-706A and IQ-8B04(M) use BCD. The spreadsheet card is Lotus-123/Lucid 3D compatible.

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Toward an API for the real numbers - robve - 10-06-2020 01:16 AM



User(s) browsing this thread: 1 Guest(s)