Discussions of Book of Mormon issues and evidences, plus other topics related to The Church of Jesus Christ of Latter-day Saints.

Friday, September 28, 2007

Multiply and Replenish . . . Your Spreadsheet

Alert for Excel 2007 users: Excel Can't Multiply. If you're doing any calculations that involve the number 65,535, you may have trouble. For example, Excel thinks 850*77.1 = 100,000, when the real answer is 65,535. And numerous calculations using 65,535 directly will give errors.

Microsoft is aware of the problem and is feverishly working to come up with a fix, or at least an explanation as to why it's a feature and not a bug.

I only mention this because much of the world's economy depends on calculations done by Excel. Perhaps much of the security of the world. Just in case you're wondering.


Anonymous said...
This comment has been removed by a blog administrator.
Jeff Lindsay said...

OK - I deleted the remark in my post that drew a well deserved groan from an anonymous commenter. (Something about the zip code 65535.)

Mike said...

Interesting. This appears to be an easter egg; someone's idea of a joke, figuring that the likelihood of actually entering that particular calculation is pretty small. If you try subtle variations on the calculation, it gives a more correct result:

65535 * 1 = 65535
850 * 77.1 = 100000
849.9999999 * 77.1 = 65534.99999
850.00001 * 77.1 = 65535.00077
850 * 77.0999999 = 65534.99992

As a software developer, I know that these sorts of things are easy to bury in code. If a member of the Excel team thought it a clever prank, it's almost impossible to catch until it's too late.vry

Bookslinger said...

Mike, as they say "don't ascribe to malice, what ignorance can explain."

I have a sneaking suspicion that it is truely a screw-up, and it's more likely that not all execution paths in the code were tested before release.

I'd bet that much code makes special meaning of 2-bytes of all 1's. And somewhere in the execution path the "16 1's" exception was "hit", but wasn't allowed for.

Anonymous said...

Interesting... I use Excel for Mac and I 850*77.1 came out 65535.

Anonymous said...

To be honest I would have suspected an easter egg as well, but Bookslinger was right on this one.


If it's any comfort, the bug only affected the display of the cell, not the value stored in it.

Mike said...

Happy to be wrong on this one! I'll admit that the 65535 struck me as significant, as 65535 is 1111111111111111 in binary or FFFF in hexadecimal.

Having read the explanation, I'm glad I was incorrect. And Bookslinger, I like the quote. :)