Excel bug from comp.arch.arithmetic

David G. Hough at validgh dgh
Fri Sep 15 09:18:36 PDT 1995


The following brings to mind a bug in the directed roundings of conversion
to integer, found in various Intel and Cyrix FPU's by Kahan; but that 
wouldn't account for it arising on PowerPC.    So it may be a base
conversion bug.

Article: 1233 of comp.arch.arithmetic
From: lindsayaazstarnet.com (Michael J. Lindsay)
Newsgroups: comp.apps.spreadsheets,comp.apps,comp.arch.arithmetic
Subject: Math bug in Microsoft Excel
Summary: A certain 15 digit number is interpreted in Microsoft Excel with a very large error.
Date: 15 Sep 95 14:17:26 GMT
Organization: Arizona Daily Star - AZSTARNET

                              Stupid Excel Tricks 
 ------------------------------------------------------------------------------------
Go to any cell in Excel.  
Type in 1.40737488355328 DO NOT PRESS ENTER
Examine that input carefully.    
Click your heels together three times while saying the magic word:
     "Microsoft".  
Now press enter. Examine the result.

Type in =1.40737488355328 
Press enter.
Examine the result.

 This happens on Excel 5 on a Mac or an IBM, also Excel 7 for 
Windows 95.  A different wrong value is observed on a Power PC.

This was discovered by Stuart Worley of Hughes Aircraft Company, Tucson
AZ when he input the following formula in a large spreadsheet.(9/11/95):
+INT((2^47)/(10^INT(LOG(2^47))))
The result "0" instead of "1" stood out of the middle of the spreadsheet. This
prompted him to investigate further.

As far as we know, INT is the only function that misbehaves with this formula
output. This misbehavior may not be evident on a Power PC.  There, the magic
number is converted to 1.28 , not 0.64.  INT will round this down to 1, 
just as if it were the correct value.  This problem has just been reported to Microsoft.

The following is copied directly from Excel:
1.40737488355328 is the magic number.

Type the magic number (above) then enter:
0.64000000000000000000000000

Type the equals key, then the magic number and enter:
1.40737488355328000000000000

The magic number / 2 =
0.70368744177664000000000000

+1 + 0.40737488355328=
1.40737488355328000000000000

For Excel Power users:

When you "paste special" the "value" function of above cell:
0.64000000000000000000000000

The "value" of the text version of the magic number:
1.40737488355328000000000000

You may say "but this is a 15 digit number.  People hardly ever use
15 digit numbers."  But remember, the problem that originally caught 
 this bug had numbers no bigger than 2 digits!

I think I will ask my boss for a pay cut by the factor 1.40737488355328.

Can someone write an Excel macro that checks a large number of numbers
looking for other magic numbers?  The question is:  how do you know the
macro will not lie to you?





More information about the Numeric-interest mailing list