Updated September 8, 1998
STUART WHITMORE was having a bad week.
The errors weren't large, but they were real, and curiously, they seemed to vary depending on what web browser he was using.
Consider the problem 81.66 times 15. The answer is 1224.9, but Netscape 2, 3, and 4 in Windows 95 may calculate the answer as 1224.8999999999999.
Meanwhile, Opera 2.x can handle 81.66 times 15 fine, but can trip on 266.66 times 15.
MICROSOFT AND NETSCAPE'S response? The two big browser makers both say that 1224.8999999999999 is in fact the correct answer to the multiplication problem, 81.66 times 15.
Before you fall on the floor laughing, please realize that there is more than one type of accuracy.
In terms of mathematical accuracy, 81.66 times 15 unequivocally equals 1224.9, as any sixth grader with a pencil and a piece of paper can demonstrate.
But in terms of accuracy as defined by the IEEE [Institute of Electronic Engineers] floating-point math standard, 1224.8999999999999 is the correct answer. In other words, the prevailing computer standard mandates a mathematically incorrect answer to the problem, 81.66 times 15.
At the root of this mathematical inaccuracy is the old issue of conversion from decimal to binary numbers. The decimal number 81.66 can not be exactly translated into binary form, and as a result the answer to the problem is slightly incorrect, in mathematical terms.
In a rare show of unanimity, Microsoft's Wascha declared, "to call this a bug in a specific product is false and entirely misleading. It runs deep and affects every programming language on both the Mac and Windows."
WHITMORE, WHO has nearly twenty years experience as a computer programmer, begs to differ.
He notes that the same calculation errors don't show up when the math is performed via Perl, the most common scripting language on the Web.
According to Whitmore, The Perl code:
$Result = 81.66 * 15;
Whitmore continued, "isn't the role of a scripting language to provide simple, efficient programming? Making people reinvent (or at least rewrite) rounding is a pretty substantial failure on the part of a scripting language."
"We're discussing it," said Wascha. "The problem is if we introduce rounding then we'll get developers yelling at us because they expect us to adhere to the IEEE and ECMA [European Computer Manufacturers Association] standards, and in these terms the rounded [mathematically correct] answer is the wrong answer."
For now, there is no fix and no work-around for this problem, except to keep a pocket calculator handy and not believe everything you read on the screen.
The answer supplied by your PC may be wrong. And the wrong answer may be right.
-- Bruce Brown
© BugNet material copyright 1994-1999 by BugNet.
This historic replica of BugNet from the period 1994-1999
BF Communications Inc.
Website by Running Dog