Version: 2008
  • On TV.com: TOP 100 Everything of 2009: 100-91

Comments on: Google's calculator muffs some math problems

The search engine's built-in calculator has some troubles with big numbers. So do we all, but this is a company that named itself after a really big number.

Add a Comment (Log in or register) (16 Comments)
  • prev
  • 1
  • next
by brianld August 25, 2008 1:36 PM PDT
Good find, and I agree that a company who names itself after such a large number should indeed be held to a higher standard. However, is anyone actually relying on Google for performing these types of computations? Wouldn't an actual scientific calculator be better, not relying on something which obviously has a varying degree of accuracy?
Reply to this comment
by mbelisle August 25, 2008 2:03 PM PDT
After all, this is the company that decided to raise $2,718,281,828 billion in its IPO, a reference to "e," the base of natural logarithms, and that invited job applicants who could solve a math puzzle.

Wow! That sure is a lot of billions! With that kind of money, Google could buy the world economy!
Reply to this comment
by ewill3 August 25, 2008 2:33 PM PDT
I'm mildly surprised at this limitation. If one uses basic 8-byte doubles, the values 9 007 199 254 740 992 (2^53 or maybe 0x4340000000000000, if one prints out the actual bytes in hexadecimal) and 9 007 199 254 740 993 are indistinguishable without longer precision arithmetic; the last bit basically falls off the mantissa, as one can readily verify using a fairly simple program. However, the above values is nowhere near these (it's 5 * 10^14 in scientific shorthand). It turns out 350 000 000 000 000 - 349 999 999 999 999 = 0, but surprisingly 281 474 976 710 658 - 281 474 976 710 657 = 1 (aka (2^48+2) - (2^48+1)) and 300 000 000 000 000 - 299 999 999 999 999 = 1 as well. I'm not about to narrow it down further, though will note that 3.00000000000000 - 2.99999999999999 = 1.02140518 * 10^-14, as opposed to the more correct 1 * 10^-14; those stray bits are erroneous but may leave a telltale as to exactly what they're doing (1.02140518 * 10^-14 is just a smidge under 23 * 2^-51, it turns out).

Just as a sanity check, the mass of a proton can be expressed as 167 262 171. * 10^-35 kg (note the unusual position of the decimal point, as I put it there to get an integer); therefore Google's precision issues are well outside those needed for even the most precise of scientific work. 3 * 10^14 is more than enough to count the number of millimeters from Sol to Earth twice over (1 AU = 1.4960 * 10^11 m).
Reply to this comment
by lndsdotnet August 25, 2008 3:28 PM PDT
Google is using 32 bits for their floating point (float type in c), check the source code of a program I had posted in my blog, it's a testing of the most plausible cause of the bug:

http://www.lnds.net/2008/08/por_que_falla_la_calculadora_de_google.html
Reply to this comment
by The_Decider August 25, 2008 6:16 PM PDT
If they are using C, then they aren't too bright.

Python and Ruby make it absolutely trivial to calculate basic arithmetic operations and expand memory usage as needed.
by Pishkado August 25, 2008 5:20 PM PDT
"Indeed, even with decades of computing technology already under our belts, it wasn't until IBM's latest flagship Power6 processor that even Big Blue could do actual decimal math without converting into binary and back."

Someone is apparently too young to know computing history and didn't bother to check the facts. IBM computers did decimal math quite nicely as far back as the 1950s. For much of that time, up to the mid-60s, it had two parallel product lines: a "scientific" line that did binary (but not decimal) arithmetic in hardware, and a "commercial" line that was the other way around. (It had binary circuitry for memory addressing, but it wasn't user-visible via the machine-level instruction set.) The two lines merged in the April 1964 announcement of System/360, which could do both. Its successors are sold today as the zSeries.
Reply to this comment
by halftechie August 25, 2008 5:26 PM PDT
MSN / Live search returns right results

http://search.live.com/results.aspx?q=400000000000002-400000000000001&FORM=ADDLVD&src=
Reply to this comment
by halftechie August 25, 2008 5:27 PM PDT
MSN / Live search returns right results

http://search.live.com/results.aspx?q=400000000000002-400000000000001&FORM=ADDLVD&src=
Reply to this comment
by The_Decider August 25, 2008 6:19 PM PDT
If you need to perform basic math operations it is downright trivial to do it in Python or Ruby since they have no problems dealing with numbers greater the 2^32, unless that is all the memory you have.
Reply to this comment
by Imalittleteapot August 25, 2008 6:34 PM PDT
Not saying that Google doesn't have a bug here, but one mistake the author may be making in general is to suggest Google returns 0 when it should be equal to 1. When dealing with floats or huge numbers you should get the thought of equality out of your head as soon as possible, or at least the type of equality that is a==b. Instead of telling yourself it should be equal to you should think it should be close to. It should be close to a range or a given accuracy that you can define and then tune for when writing your code.

Another problem is computers like to throw numbers away. Humans like to round up. Computers don't care to round at all. In fact they prefer to truncate and just throw numbers away unless you code it not to. If it's throwing numbers away, especially in a loop, then you'll need to deal with that too.

Anyway, I'm going to look at lndsdotnet's code now to see what they think the deal with this particular bug is, but it might help if you think about it like this. Google shows that an unknown number that equals zero after truncating it should be close to 1. They probably just let the computer handle it how the computer wanted and that's not the best thing to do.
Reply to this comment
by slecalvez August 25, 2008 8:01 PM PDT
If this was Microsoft, it would've been harshly criticized.... But it's Google, which is all about the hype.
Reply to this comment
by Imalittleteapot August 25, 2008 8:26 PM PDT
Google was criticized here. This whole article was a criticism. I just don't think you noticed because you didn't read the comments carefully enough. Google has been getting criticized more and more too. Didn't you pay any attention to the street view debacles?

Neither Microsoft or Google is going to get criticized on this as hard as other things because this is a problem inherent to how computers work in general. This is not just a Google problem or a Microsoft problem. So, you'd get a completely different type of criticism than you would in situations like when IE doesn't follow standards just because.

Similar things have went wrong with Microsoft products too, but the biggest complaints about Microsoft are usually closed source, wasted resources, and security. Hardly ever does anyone claim that Microsoft can't subtract.

The problem isn't that Google is not getting criticized. The problem is that when they do get criticized you just don't happen to be around because of your bias. Both companies get complained about plenty enough.
by i_am_still_wade August 26, 2008 9:41 AM PDT
Question: WHO USES GOOGLE TO DO MATH!!!!!! Calculator programs are as common as dirt, and people are using Google to do math?
Reply to this comment
by gauravakagary August 26, 2008 11:48 AM PDT
seriously...who uses google for maths??? and why would someone do that??
Reply to this comment
by just_me_here September 19, 2008 10:28 AM PDT
I'm a huge fan of Google, and of Edward Kasner, who popularized the term "googol". But you are all wet on this calculation thing.

First of all, "google" <> "googol". Since the name is based on a well-meaning misspelling, I'd say that lets them off the hook. Particularly on calculations that would interest almost nobody. You are just being silly. No other ideas for an article?

Your comparison with Intel and Microsoft is also way, way off. Both are in the business of calculation. Google's business is not calculation. Nobody is calculating a rocket trajectory with a search engine.

Who cares about absurd precision? Nobody. This is just a ho-hum excuse for writing an article, and nothing else.
Reply to this comment
by jerthy35 March 15, 2009 10:31 AM PDT
Schanderfude on botched calculations highly unusual and unnatural numers. I guess someone needs to get a life.
Reply to this comment
(16 Comments)
  • prev
  • 1
  • next
advertisement

About Webware

Say No to boxed software! The future of applications is online delivery and access. Software is passé. Webware is the new way to get things done.

Add this feed to your online news reader

Webware topics

Five New Year's resolutions for Google

Stakes are high as Google attempts to maintain one of the Internet's greatest cash machines while pushing into new and risky markets.
• Android event set for Jan. 5

For eBay sellers, a holiday hamster hangover

The gift frenzy over Zhu Zhu Pets leaves some power sellers feeling like they've just run a marathon--but the steep price tags lead to some impressive profits.