1. Download our Official Android App: Forums for Android!

My Desire calculator calculates incorrect

Discussion in 'Android Apps & Games' started by Harry2, Oct 31, 2010.

  1. Harry2

    Harry2 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    323
    Posts:
    5,186
    Joined:
    Jun 3, 2010

    Jun 3, 2010
    5,186
    1,347
    323
    Black Forest
    Hi,

    I search a better calculator for my Desire.

    The stock calculator calculates incorrect,
    e.g. 100-99.9=0.0999999999

    The new calculator should very easy to use (and calculate correctly).
    Mathematical functions to show graphically would be nice :)

    With these many, many calculators in the market it is hard to find the right.

    Harry
     

    Advertisement

  2. Chilly McFreeze

    Chilly McFreeze Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    166
    Joined:
    Aug 30, 2010

    Aug 30, 2010
    166
    35
    63
    Oracle Developer
    RealCalc is my favorite, because it looks (and functions) exactly like the scientific calculator I used at school!
     
    Harry2 likes this.
  3. Szadzik

    Szadzik Android Expert
    Rank:
    None
    Points:
    223
    Posts:
    5,413
    Joined:
    Feb 15, 2010

    Feb 15, 2010
    5,413
    715
    223
    Male
    FAS Admin
    I have always used Retro Calculator.
     
    Harry2 likes this.
  4. Crumm

    Crumm Member
    Rank:
    None
    Points:
    16
    Posts:
    71
    Joined:
    May 3, 2010

    May 3, 2010
    71
    7
    16
    Alaska
    Calculator by Stormin Dormin works good.
     
    Harry2 likes this.
  5. Sloper59

    Sloper59 Lurker
    Rank:
    None
    Points:
    25
    Posts:
    8
    Joined:
    Oct 28, 2010

    Oct 28, 2010
    8
    0
    25
    Nr. Manchester, England
    Strange. I just tried that calculation on my Desire HD and it gave the same result! What's happening there?
     
  6. JimSmith94

    JimSmith94 Android Enthusiast
    Rank:
    None
    Points:
    63
    Posts:
    322
    Joined:
    May 5, 2010

    May 5, 2010
    322
    67
    63
    Irving, TX USA
    Same result on my Sprint Evo!
     
  7. Harry2

    Harry2 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    323
    Posts:
    5,186
    Joined:
    Jun 3, 2010

    Jun 3, 2010
    5,186
    1,347
    323
    Black Forest
    Thanks, the proposed calculators of yours calculates properly! :)

    So it is a bug in the HTC calculator?

    Harry
     
  8. KlaymenDK

    KlaymenDK Android Expert
    Rank:
    None
    Points:
    143
    Posts:
    1,217
    Joined:
    May 29, 2009

    May 29, 2009
    1,217
    130
    143
    Denmark
    This is most likely because the calculator isn't using enough internal precision (that is, the right type of variable for floating-point math; possibly a float where a double should have been used).

    The thing is, computers love numbers but inherently suck at decimals. :eek:
    You know how you can express "1/2" quite perfectly as "0.5", but for "1/3" you get the problem that "0.33333..." is never going to be entirely accurate? The same thing happens in binary, only on different occasions.

    So when you hit one of those occasions, you will see a precision error in the form of a number that is "ever so slightly" smaller or larger than you'd expect.

    Wikipedia: Representing_fractions_in_binary gives the following example.
     
    Harry2 likes this.

Share This Page

Loading...