Bug in Excel 2007

M

megazzt

This is simple rounding error. Down at the hardware level of PCs,
when working with floating point numbers, you are only guaranteed a
number of significant digits (varies depending on the size of the data
type). In this case, your numbers are good up to 7 digits (NNNNN.NN),
which fits with the double data type in C.
 
M

michael.e.brown

This is simple rounding error. Down at the hardware level of PCs,
when working with floating point numbers, you are only guaranteed a
number of significant digits (varies depending on the size of the data
type). In this case, your numbers are good up to 7 digits (NNNNN.NN),
which fits with the double data type in C.

Complete and utter BS. As pointed out, the Excel representation holds
absolutely nothing in common with either the computers native FP
result, nor with the IEEE standard for floating point.
 
M

Michael C

*alan* said:
It may be an insignificant coincidence, but I found it interesting that in
the article mentioned below, it's stated that the incorrect representation
of numbers ending in .848 occurs between "32,768 and 65,535". Isn't
65,535 the product that's getting misrepresented as 100000 when you
calculate 850*77.1 in Excel2007?
Perhaps they were finally attempting to address the previous bug, and just
mucked it up even more?

Bugs are usually found on boundaries. In this case 65535 is the smallest
number that fits into 16bits and 65536 requires 32 bit. Although excel will
use floating point for the numbers so it might not apply in this case there
is likely some significance.

Michael
 
M

Michael C

Harlan Grove said:
Actually, I'd guess someone was trying to rewrite the 15 decimal
digits truncation code but screwed up, perhaps missing a bitwise AND
or XOR. I wonder how many programmers on the Excel team have any
experience with assembler? I'd guess not many, if any.

I'd be EXTREMELY suprised if not one person or even only a few on the excel
team had experience with assembler. Remember all these programmers would be
using C which has all the power of assembler with the ease of use of
assembler.

Michael
 
M

Michael C

Complete and utter BS. As pointed out, the Excel representation holds
absolutely nothing in common with either the computers native FP
result, nor with the IEEE standard for floating point.

Are you saying excel doesn't use the FP processor? How then did the previous
intel floating point bug appear in excel?

Michael
 
H

Harlan Grove

Michael C said:
Are you saying excel doesn't use the FP processor? How then did the
previous intel floating point bug appear in excel?

Excel uses the FPU for INTERMEDIATE calculations, but the final value
of any cell formula gets passed through some, er, MSFT value-added
processing before it becomes the cell's value. This is how
nonparenthesized expressions are implicitly rounded to 15 decimal
digits. Also, and quite unfortunately, some built-in function calls
perform additional and usually unnecessary postprocessing of FPU
results, e.g., MOD(2^30-1,3), which returns #NUM! because MOD can't
handle arguments that produce quotients comfortably within 32-bit
integer or 64-bit double precision bounds even though this is well
within the FPU's capabilities.

I don't think this is the case for 850*77.1. I suspect some bright
spark on the Excel development team decided to rewrite their machine
representation-to-human representation internal number formatting
function, and they screwed it up somehow.

What really concerns me is what Dana DeLouis pointed out: with A1
containing =850*77.1, =A1+1 returns 100001 while =A1-1 returns 65534.
That's VERY, VERY BAD because it implies the value in A1 isn't just
fed directly to the FPU stack. It's subjected to, er, value-added
preprocessing which seems to differ depending on what the precise
operation is. What I'm most worried about, given Dana's other
examples, is whether someone thought they were doing Excel users a
favor by treating increment (+1), decrement (-1), idempotent
operations (+0, *1, ^1), binary left shift (*2) and binary right shift
(/2) as special cases in the formula parser. MSFT *DID* rewrite parts
of the formula parser in XL2007, which is how they lifted the 7 nested
function call limit etc. I'd bet they rewrote too much of it.
 
S

Sharath

Simply when you try to multiply 850 by 77.1 excel display the result to be
100000 !!!

Guess this bug was introduced recently.

I use Excel 2002 (10.6823.6626) at work and it shows the answers
correctly as 65535.

-Sharath
 
J

Jerker Pihl

Simply when you try to multiply 850 by 77.1 excel display the result to be
100000 !!!

With an old office xp excel I get the correct answer :-D
Regards
el0
 
A

agni.asgeirsson

Excel 2000 gives the correct answer.
Gene

Excel 2003 Sp2 gives the correct answer for 850*77.1, but when I
format tha number as Hex with Dec2Hex I get FFFE which is one off!.
Dec2Hex(850*77.1+1) results FFFF but Dec2Hex(850*77.1+2) results the
correct value of 10001.

Agni
 
P

Peter Ross

Simply when you try to multiply 850 by 77.1 excel display the result to be
100000 !!!

I wonder if this could be related to another oddity of Excel, present
in 2007 and in various earlier versions.
Choose a number x, use Excel to calculate the STDEV of the numbers x
+1, x+2, .., x+10. The correct
answer should be 3.027650354.. However, there are various jackpot
values of x that give other answers.
For example, x=9989999999223 gives a STDEV around 123575.8667. If you
vary that x slightly, say by adding
0.05, the STDEV changes to other very large values.

Excel seems capable of working with these sorts of large numbers; for
the above x, calculate y = 49*x*x
and then z = SQRT(y)/7 and you recover x correctly. The problem does
not seem to be due to an earlier
flaw, now fixed by Microsoft, of using a poor choice of method of
calculating STDEV.

At a guess, it appears to be an issue to do with internal change of
representation.
 
D

dougaj4

It's interesting to write a short function that simply adds 1 to a
cell containing the erroneous result, e.g.

Function testmult(val) As Double
testmult = val.Value + 1
End Function

This will return 100001 (when declared as a double, variant, or
unspecified), but if you step through it VBA at least knows that it is
really 65536.

Also if you declare it as a Single it will return the correct result
(65536)
 
M

minhtam.nguyen

I expect this to bring the adoption of Office 2007 to my workplace to
a massive slowdown, as most people rely on it here and won't be happy
to hear about this. And just when IT was pushing so hard to get it
through.
 
C

Cactus77

hhmm.... wat suprises me is that the maximum quantity of rows in Excel
2003 is 65.536.
Is it just a case of coincidence or......????

:)
 
J

jonmoulding

Simply when you try to multiply 850 by 77.1 excel display the result to be
100000 !!!

Multiplying 666 by 98.4009009009009 wrongly gives 100000. Could this
be the work of the devil himself and not Microsoft's fault at all?
 
J

jimtreu

Oddly, I also multiplied 2 * 10.2 * 3212.5 and got 100000, so it is
not just when you multiply 2 numbers that equal 65535, it is when
certain combinations of number add up to 65535...

Also tried 2 * 10.2 * 642.5 * 5 and it is 100000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top