11 Replies Latest reply: Nov 12, 2012 5:20 PM by steve359
Level 1 (0 points)

Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?

iPhone 4
• 1. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 4 (1,210 points)

I get 5 on my iPhone 5.

Keys...

17.5  "-"   .5    "="   17   "+"   3   "="   20   "Div"  4  "="   5

• 2. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 1 (0 points)

I get 17.75 on my iPhone 4.

• 3. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 1 (0 points)

IF I punch the "=" between each you do get 5 punch if you don't hit "=" between each you get 17.75. I don't have to keep hitting "=" on a regular calculator.

• 4. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 6 (12,040 points)

Could be AOS ... Algebraic Operating System operator priority.

3/4 is performed first, yielding .75

17 - 0.5 + 0.75 = 17.75

Different applications prioritize multiply/divide over plus/minus.  Try putting () around the first 3 operations in iPhone/iPad to ensure thay are done first.

• 5. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 4 (1,210 points)

What you did was...

17.5 "-" .5  "+" 3 "Div" 4 "="   17.5

Different key strokes made the outcome change.

• 6. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 7 (25,950 points)

Geff S wrote:

IF I punch the "=" between each you do get 5 punch if you don't hit "=" between each you get 17.75. I don't have to keep hitting "=" on a regular calculator.

That's because a "regular" calculator is too stupid to understand precedence of operations. As you learned (I hope) in 7th grade math (or possibly earlier if you went to a good school) in a string of operations multiplication and division are evaluated first, then addition and subtraction. So in your example 3 divided by 4 is evaluated first, then the result (.75) is added to 17.5 - .5. Giving the correct answer of 17.75.

BTW, my "regular" calculator also give the correct answer.

• 7. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 6 (12,040 points)

I prefer RPN calculators.  Precedence is irrelevant.

But to each his/her own.

• 8. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 7 (25,950 points)

Yes, my "regular" calculator is an HP-12C, which does RPN. I also have a HP-12C emulator on my iPhone.

• 9. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 4 (1,210 points)

My answer in the above actually was 17.75 not 17.5

• 10. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 6 (12,040 points)

My "daily sacrifice-capable" HP is a 28S ... infinite stack instead of just X/Y/Z/T.  But battery door will eventually pop off for good and many many function never used.

I bought a 15C that HP re-released that uses 2 CR2032 instead of the original 3 baby batteries.

• 11. Re: Do the following math in your head: 17.5 minus 0.5 plus 3 divided by 4 = ? ; now do the same arithmetic on any stand alone hand held calculator. Same answer right? Now do the same on the iPhone/iPad calculator app. Why the different answer?
Level 6 (12,040 points)

I hope this additonal information is relevant ...

If you plan to write in any programming language (Java, Perl, C, C++) you need to familiarize yourself with the "operator precedence" chart.  Programmed states get very tricky mixing "->" (accessing structure member through a pointer) "++" pre-increment such as "++strptr->strmember" and the precedence chart is crititcal to programmers.