Calculator Wrong Answer

hitec

New Member
Joined
Mar 14, 2010
Messages
2
Reaction score
0
Location
Alabama
Today I was double checking some numbers and according to the Droid Calculator 3279.18 - 3278.78 = .3999999
Can anyone confirm this happens with theirs?

Further testing gives the correct answers
9.18 - 8.78 = .4
79.18 - 78.78 = .4
279.18 - 278.78 = .4

I am running Chevy 1.25GHz ULV on Simply Stunning 4.4. Slowing down the CPU does not affect the calculator results at all.
 

JCo352

Senior Member
Joined
Feb 11, 2010
Messages
1,824
Reaction score
0
Location
Texas
I get .3999999999 but I have a calculator from some other phone I cant remember what it is though.

Edit: It's from the Desire.
 
Last edited:

jacobrv

Member
Joined
Jan 18, 2010
Messages
100
Reaction score
0
It is not a rounding problem, it is a problem with how floating point numbers are stored in computers. My suggestion, download RealCalc Scientific Calculator from Brain Overspill. That's the one I use, and when I tried your problem it worked fine.

For more info on floating point numbers see here: https://secure.wikimedia.org/wikipedia/en/wiki/Floating_point

EDIT: In the built in calculator I did get .3999999.
 
Last edited:

Joker

Member
Joined
Apr 10, 2010
Messages
266
Reaction score
0
Location
BFE
That's interesting. I get the same answer as well. I guess I will have to get that RealCalc app mentioned above. Thanks for the heads up.
 
OP
H

hitec

New Member
Joined
Mar 14, 2010
Messages
2
Reaction score
0
Location
Alabama
Thanks everyone for confirming that is was not just my droid. I thought it was interesting that the floating point error shows up in a simple subtraction.

jacobrv. Thanks for the heads up on RealCalc. It is overkill for most of my needs, but the main thing I want in a calculator is a correct answer. :)
 
Top