CNET también está disponible en español.

Don't show this again

# 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. Updated at 7 p.m. PDT with Google comment.

Google's calculator has some trouble handling math with some large numbers, an issue that's not unheard of in computing circles but that might not sit well at a supremely nerdy company that's named after a humongous number.

The errors appear, though not consistently, with some very large numbers. For example, 2,999,999,999,999,999 minus 2,999,999,999,999,998 should be 1, but Google calculator shows it as 0.

It's not a simple case of a cutoff where things fall apart, though. 1,999,999,999,999,999 minus 1,999,999,999,999,995 incorrectly equals 0, but 1,999,999,999,999,999 minus 1,999,999,999,999,993 correctly equals 6. And 400,000,000,000,002 minus 400,000,000,000,001 incorrectly equals 0, but 400,000,000,000,002 minus 400,000,000,000,000 correctly equals 2.

Perhaps most amusing for the schadenfreude crowd, Google botches some math involving a googol, which is 1 followed by 100 zeros. The quantity of a googol plus one, minus a googol, equals 0 rather than the correct result, 1.

To be sure, math is difficult at this scale, where special methods for encoding numbers must be used if fine precision is to be maintained. Happily for those building calculators, though, it's a relatively unusual requirement in the real world: when measuring numbers on the magnitude of the distances between stars, it's rare that precision of a few centimeters can be obtained. And it's also rare that such precision actually is relevant.

Big numbers are often expressed with a two-part floating-point format, with some small number (the mantissa) multiplied by 10 to some power (the exponent). For example, Google's revenue in the second quarter was \$1.25 billion, which also can be expressed as \$1,250,000,000, or as \$1.25 times 10 to the power of 9, or as \$1.25 x 10^9. Floating-point math is good at spanning vast ranges of numbers, but typically the first component only keeps track of limited number of digits, so the small change falls by the wayside.

Precise math on computers is compounded by the fact that computers typically work in binary math, with digits of only 0 or 1, whereas people operate in decimal math, with digits running from 0 through 9. Accuracy is compromised when computers convert numbers into binary for processing, then back to base 10 to show us the results.

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.

Ordinary calculators quickly run out of steam when trying to deal with large numbers. Sure, Google may have some issues, but most handheld calculators don't even let you type the number 1,999,999,999,999,993 much less do some mathematical operation on it. And there's not a big market for software such as Wolfram Research's Mathematica that can get the math right.

Google acknowledged its math is imperfect. "We are aware that the calculator tool in Google Web search is not working properly for certain calculations, and we are looking into this problem further. We apologize for any problems that this causes our users," the company said in a statement.

So big math is deceptively difficult. Should Google be forgiven for shortchanging us a bit when it comes to significant digits?