Microsoft Bing Still Spamming Fake Referrers In Webmaster Log Files | Main | Google Advertising Professional Accounts Can Now Be Transferred

Google Can't Subtract?

I spotted a thread at Google Web Search Help which shows how Google can not subtract the numbers 999999999999999 - 999999999999998. Google returns the result as 0, when Yahoo and Bing return the correct result of 1.

Google:
Google Calculator Wrong

Yahoo:
Yahoo Calculator Right

Bing:
Bing Calculator Right

Why is Google returning zero as the answer to this calculation? Is there some type of geek response to this or is Google's calculator malfunctioning?

Forum discussion at Google Web Search Help.



Like The Story? Vote For It On Yahoo Buzz! Or On Sphinn!

posted rustybrick in Google Search Engine at August 25, 2009 8:32 AM Comments (3)

Comments

Number is too long, that is all. Same on all calculations over that size.

 

I believe this has to do with the floating point. This problem has been known for a few years and I read a really good explanation about it a while back, but I can't find it now :(

 

Google is using floating point for calculations. This is essentially scientific notation in base 2 - google really just has a value like 7450580 * 2^27 for both. The reason it has the same for both is because it had only a range of 0..2^23-1 for the significant portion of the exponent, and had to divide by 2^27 and round to get it to fit. The difference of 1 is then just lost in that rounding.

Yahoo and Bing aren't immune to this either - they just use a larger floating-point type. Try 9999999999999999999 - 9999999999999999998 in all three :)

 

Post a comment (Note: Can Take 120 Seconds For Your Comment To Show Up)

Do you want us to save your personal Information?

Premium Sponsors + advertise

To subscribe to the Search Engine Roundtable, click here