Log in

No account? Create an account

Previous Entry | Next Entry

Google calculator bug

Try dividing some number by zero. I'm surprised this got past QA.


( 9 comments — Leave a comment )
Apr. 29th, 2005 11:11 pm (UTC)
I heard about this a couple months ago. I'm surprised it's not fixed yet.
Apr. 29th, 2005 11:15 pm (UTC)
For comparison's sake, try tan(pi/2).
Apr. 29th, 2005 11:18 pm (UTC)
yeah, but that seems a bit more legitimate; I'm assuming everything is floating-point internally.

tan(pi*10^n) for large-ish integers n is interesting as well.
Apr. 29th, 2005 11:28 pm (UTC)
"yeah, but that seems a bit more legitimate; I'm assuming everything is floating-point internally."

That's what I was thinking. It makes me wonder why you don't get the same type of error on division by zero.

Apr. 29th, 2005 11:49 pm (UTC)
problems begin with tan(pi*n) and sin(pi*n) for n >= 255.

Apr. 30th, 2005 02:23 am (UTC)
I'm not surprised. I don't know much of the innards of floating-point arithmetic.
Apr. 30th, 2005 04:04 am (UTC)
Well you know, those Google people are smart. They are probably too smart to waste their time on simple things, they just don't see them. They are busy thinking smart complicated thoughts.
Apr. 30th, 2005 05:40 am (UTC)
Interesting point. I wonder if the criteria for QA people differ from that for software engineers? Are they expected to be high-IQ-type problem solvers? Is this given more weight than the skill of software testing?

I was trying to guess how these math functions might have been implemented. At first I thought they might have just used some preexisting calculator/expression handler as a backend. But now I'm not so sure. In addition to the 'googol' feature I wrote about, another interesting thing I discovered was that if you give it an expression with an integer in the numerator and a complex number in the denominator, it will multiply numerator and denominator by the denominator's complex conjugate. But it will attempt to compute the value of an expression where the denominator contains an irrational radical, rather than simplifying it. So perhaps this was something that was written from scratch. At any rate, I wonder what tests it had to pass before it was put into production.
Apr. 30th, 2005 05:11 am (UTC)
Interesting that if you give it 10^100 or some expression whose result is 10^100, the answer you get is 1.0 x 10^100, but if you use 'googol' in an expression it will treat it as the value 10^100. BTW, there's no mention of 'googol' in the calculator documentation.
( 9 comments — Leave a comment )