Wednesday, September 26, 2007

The Excel Bug


A very interesting bug was found in Excel 2007: apparently, if you multiply 850 by 77.1 the result you get is 100,000 (rather than 65,535). Above, you can see my verification of this.

Of course, now you wonder what other errors are hiding inside. "Can we trust the numerical output of Excel?" you ask.

This bug reminded me of the big Pentium Floating Point debacle of 1994. Unlike Intel, Microsoft is not denying the existence of the bug, and unlike a hardware company, they can issue a patch (soon hopefully).

Joel attempts to explain this bug. His explanation is very interesting, involving binary and string representations and showing a pattern of similar cases that will crop up. I will not bore you with the full drill-down, but here's Joel's parting shot:
And let's face it -- do you really want the bright sparks who work there now, and manage to break lots of perfectly good working code -- rewriting the core calculating engine in Excel? Better keep them busy adding and removing dancing paper clips all day long.

No comments: