Can anyone explain why the phone's calculator would say this?

TnTexas

Well-known member
Apr 20, 2011
72
2
0
So I go to do this math problem on the Thunderbolt's calculator: 2983.21 - 2980.51 =

And instead of getting 2.70 like I do when I work the problem by hand or on my desktop's calculator, I get 2.6999999999 (yes, that six is followed by 9 nines - I counted them).

Anybody have any idea why it would do that?
 
Same result if you just type in 83.21 - 80.51 and leave out 2,900 from both figures.

Thanks, Robrecht
 
I think its because the numbers 2983.21 and 2980.51 in binary require infinite bits to get an exact representation of the decimal numbers. This forces the numbers to be approximations in the calculator, causing the error in the displayed answer.

There may be more to it than that though (didn't read nater's links).

What surprises me is my phone gives me the correct answer. (rooted running das bamf so it may be a different calculator)


... took out my digital logic book and signed up here just to post this, lol.
 
interesting... But makes sense.

FYI, I have the "RealCalc" app, which is a pretty nice scientific calculator, and gave the correct answer of 2.7 as well...
 
  • Like
Reactions: cadzilla74
I think its because the numbers 2983.21 and 2980.51 in binary require infinite bits to get an exact representation of the decimal numbers. This forces the numbers to be approximations in the calculator, causing the error in the displayed answer.

I just curled up into a fetal position sucking my thumb and started to cry for my mommy. Lol.
Hence the effects of having Dyscalculia.
 
A common type of floating point math error.

Find another calculator.
 
RealCalc is awesome - back when I was cooking ROMs I would always swap out the stock calculator for that app. Must have if you need to do anything past middle school math :)

Sent from my Nexus S