Calculator Broken- this is a good one.

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by fenlyn, Nov 10, 2003.

  1. fenlyn macrumors newbie

    Joined:
    Nov 10, 2003
    Location:
    Atlanta
    #1
    Check out this attached file... paper tape can't add or subtract. Perhaps it needs a lesson in basic math.

    Brad
     

    Attached Files:

  2. fenlyn thread starter macrumors newbie

    Joined:
    Nov 10, 2003
    Location:
    Atlanta
    #2
    and this one too!
     

    Attached Files:

    • calc.jpg
      calc.jpg
      File size:
      24.4 KB
      Views:
      1,014
  3. j33pd0g macrumors 6502

    Joined:
    Mar 20, 2003
    Location:
    Central NY
    #3
    I don't get it. Are you talking about how the tape doesn't auto round?
     
  4. fenlyn thread starter macrumors newbie

    Joined:
    Nov 10, 2003
    Location:
    Atlanta
    #4
    No... I was figuring out my bills. I found it odd that the calculator display showed the correct answer to my addition and subtraction, but the paper tape is showing an incorrect answer. I never added or subtracted .00000000000001 when I was doing my bills. The fact that the paper tape is not capable of basic math is what I found amusing.

    Called Apple about it today, and they said they hadn't even heard of the bug. The support person I was talking to was running 10.3, so I was able to demonstrate it to her. Bug doesn't appear in 10.2... seems like Calculator got a facelift for Panther.
     
  5. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #5
    It's typical of real (floating point) numbers on computers to be that inaccurate since real numbers cannot be simply described. Most floating point units use the IEEE-754 standard for describing and calculating real numbers but it is built more for scientific calculations.

    In fact, most programming languages are incapable of handling money correctly. COBOL and RPG (II/III/IV) have proper types which can be specified with a fixed number of decimal positions that do not falter as do C, C++, Objective-C, Java, etc.
     
  6. Wyrm macrumors 6502

    Joined:
    Jan 7, 2003
    Location:
    Toekeeyoe, Japan
    #6
    I thought it was just a VPC quirk but the same thing appeared in Virtual PC6.1 running Windows2000 under OSX10.3.

    On the update it said it had to download something like 15.000000000001 MB

    I wonder if there is a problem in OSX?

    -Wyrm
     
  7. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #7
    Nope, this is a common problem with trying to do decimal arithmetic in binary.

    Try representing 0.1 in binary and you'll see the problem.

    Better yet, try doing all your math in base 'e'.

    Most programs round so you don't notice it, but the inaccuracy is in most programs. If they try to show too many sig figs it will show.
     
  8. steadyeddie macrumors member

    Joined:
    Oct 24, 2003
    #8
    Think yourself lucky... anyone remember when the Windows 95 calculator used to do this:

    1.01 - 1 = 0.0

    Pretty big rounding error if you ask me!

    :D
     
  9. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #9
    I'm running 10.2.8 and have the same problem (Calculator version 3.0).
     
  10. johnnowak macrumors 6502

    Joined:
    Jul 24, 2003
    Location:
    New York, New York
    #10
    For heaven's sake, every program ever has done this internally.
     
  11. rainman::|:| macrumors 603

    rainman::|:|

    Joined:
    Feb 2, 2002
    Location:
    iowa
    #11
    i remember this coming up some time ago. not complaining about a dup thread, 'cause this was a looong time ago, just agreeing that it's not a new issue.

    pnw
     
  12. Powerbook G5 macrumors 68040

    Powerbook G5

    Joined:
    Jun 23, 2003
    Location:
    St Augustine, FL
    #12
    I remember the original Pentium processor had a big error with its math co-processor which led to all kinds of quirks when the first Pentiums came out with Windows 95.
     
  13. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #13
    Right. Most compilers for x86 code generation include a flag to tell the compiler to create FDIV instruction code that is Pentium safe. It was only the first 500 processors but then, the 486s and 386s had divide problems too.
     
  14. crash_harddrive macrumors newbie

    Joined:
    Jan 17, 2004
    Location:
    Troy. Ohio
    #14
    Calc error

    I just got off the phone with Mac tech support, it seems this is a more common error than I assumed at first. I have a G5 which can't do basic math (and this is in the calculator display, not the tape) but the tech I talked to repeated the problem on a G3 iMac. Seems like a shame that I spent about 4 grand on a computer and now I'll have to spend another $30 on a desktop calculator so I can balance my checkbook. The tech referred me to an article that basically reads "Sorry about your luck", it seems that Apple doesn't find the calculator important enough to fix. BTW, I downloaded two freeware calc apps and both had the same problem so this is a Mac problem in general, not the application. I am at a loss as to why the beast of Redmond can make a working calc program but Apple is clueless. It seems to me that if Apple can't make a working calculator they should leave the app out entirely.
     

    Attached Files:

    • calc.jpg
      calc.jpg
      File size:
      15.5 KB
      Views:
      553
  15. NuPowerbook macrumors member

    Joined:
    Jan 17, 2004
    #15
    Re: Calc error

    As stated, this is a problem with floating point arithmetic. Any calculator program I have made in C++ I have always put error checks in, which isn't that difficult. Also, I believe the reason that you notice in on windowsupdate with Windows under VPC is because of the floating point arithmetic while converting from x86 to PPC. I don't know much about the PPC architecture (new to Macs), but I am also wondering why this seems to be more prevalent in the Mac calculator programs. Are the programmers just lazy in putting in checks for this, or is this an inherent inadequacy of the PPC architecture?
     
  16. kevyeung macrumors newbie

    Joined:
    Jan 17, 2004
    #16
    Some good experience.

    I'm running in 10.2.8.
    Problem in "Calculator" shared.
    "TopCalculette Pro U-3.5" works fine even with paper tape.
    Besides, "Graphing Calculator 1.3" in Classic mode also works though there is no traditional paper tape.

    ;)
     
  17. Vector macrumors 6502a

    Vector

    Joined:
    Feb 13, 2002
    #17
    I tried doing the same exact calculations and it did them fine. I am using version 3.1.
     
  18. NuPowerbook macrumors member

    Joined:
    Jan 17, 2004
    #18
    Turn on the paper tape, and do the original calculations. It gives the floating point error shown. I am running 3.1 also.
     
  19. awulf macrumors 6502

    Joined:
    Mar 1, 2002
    Location:
    South Australia
    #19
    I get this error too in Calculator 3.1, I'm running a G4. I tried the same thing in a Ti-81 emulator but its decimal places doesn't go that far.
     
  20. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #20
    I am surprised that Apple let this through; although this is a common problem in binary arithmetic it's usually handled by taking care of significant digits.

    I've now seen the binary precision issue in the regular calculator display. Since it was a completely innocent example (I was doing real math, not trying to break the calculator) I have to believe it will be a regular ocurrence.

    Of course, this being OSX, I just avoid it by using xcalc :)
     
  21. abhishekit macrumors 65816

    abhishekit

    Joined:
    Nov 6, 2003
    Location:
    akron , ohio
    #21
    well that happens because the precision is set to 12 digits..just goto view-precision and set it to 2..viola it works again...i dont get how this can be considered a bug?!!
     
  22. NuPowerbook macrumors member

    Joined:
    Jan 17, 2004
    #22
    I take it you have never programmed a something that did floating point arithmetic. It's a bug because that's not what the answer is. Do it in your head, on paper, with a handheld calculator, and you will see it is wrong. When doing floating point arithmetic, a lot of casting goes on, so there are inevitable mistakes. Most programmers will take the time to put something in to prevent or catch something like this from happening. Setting the precision to two will only cover it up, not fix it.
     
  23. abhishekit macrumors 65816

    abhishekit

    Joined:
    Nov 6, 2003
    Location:
    akron , ohio
    #23
    yah..never...but anyways i think the guy who started the thread was looking to use the cal and not invent it...
     
  24. NuPowerbook macrumors member

    Joined:
    Jan 17, 2004
    #24
    I know, but you said it isn't a bug, when it clearly is. I was just explaining why it is a bug.
     
  25. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #25
    Floating point math and money really don't mix well, so I'd call it a dubious design choice on Apple's part.

    The problem they would have been trying to avoid is that doing arithmetic the same way we would do it by hand (in decimal, and really working with arbitrary length integers -- the decimal point is just a place marker) can be slow for computers to simulate.

    On the other hand, a calculator is a perfect candidate for "bigint" math in the REXX tradition, since it's interactive and those delays would go unnoticed.

    edit: How to do it right
     

Share This Page