Calculator Wrong Answer

Discussion in 'Android General Discussions' started by hitec, Jul 16, 2010.

  1. hitec

    hitec New Member

    Joined:
    Mar 14, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Alabama
    Ratings:
    +0
    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.
     
  2. BobthePhotoGuy

    Joined:
    Dec 7, 2009
    Messages:
    82
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    interesting

    same answer here
     
  3. BigMcGuire

    BigMcGuire Active Member

    Joined:
    Dec 13, 2009
    Messages:
    1,040
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Los Angeles, California
    Ratings:
    +2
    Mine does the same. BB .4 (Froyo) with Chevy's ULV 1.0Ghz.
     
  4. dolpns13

    dolpns13 Member

    Joined:
    May 10, 2010
    Messages:
    416
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Dirty Jersey
    Ratings:
    +0
    same here. For some reason it isnt rounding up
     
  5. JCo352

    JCo352 Senior Member

    Joined:
    Feb 11, 2010
    Messages:
    1,825
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Texas
    Ratings:
    +0
    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.
     
    #5 JCo352, Jul 16, 2010
    Last edited: Jul 16, 2010
  6. dolpns13

    dolpns13 Member

    Joined:
    May 10, 2010
    Messages:
    416
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Dirty Jersey
    Ratings:
    +0
    excel give me .4
     
  7. jacobrv

    jacobrv Member

    Joined:
    Jan 18, 2010
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +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.
     
    #7 jacobrv, Jul 16, 2010
    Last edited: Jul 16, 2010
  8. Joker

    Joker Member

    Joined:
    Apr 10, 2010
    Messages:
    266
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    BFE
    Ratings:
    +0
    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.
     
  9. hitec

    hitec New Member

    Joined:
    Mar 14, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Alabama
    Ratings:
    +0
    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. :)
     
Search tags for this page
android calculator app wrong
,
android calculator gives wrong percent
,
android calculator incorrect
,

android calculator wrong

,
android calculator wrong format
,

calculator wrong answer

,
calculator wrong format
,
can a calculator be wrong
,
samsung calculator wrong format
,
wrong answer calculator