PDA

View Full Version : Windows Calculator Flaw?


danball1976
8 Jun 2003, 4:20pm
I saw this at the AMDMB forums. A guy made a mention of how if you take 8/9 and then the % key in Windows Calculator will return 0.72, but really should return 88.888888889 and I then took my Casio fx-115MS Scientific Calculator and did the same, it return 88.888888889.

Whats even stranger on the Windows Calculator is that 9/8 and then the % will return 0.72 also, but on my calculator that will return 112.5

MERRICK
8 Jun 2003, 7:41pm
hey Dan!

I only have win9.x calculators. Is this fact also in the w2k and xp calculator?

Would this happen in a third party calculator?

:scratch:

Peckers
8 Jun 2003, 7:54pm
sometimes I get

89/98 % = 87.22

othertimes I get the right result...

on winXP

danball1976
9 Jun 2003, 3:39am
Its in WindowsXP, that guy has Windows XP w/o SP1

Gargoyle
9 Jun 2003, 7:47am
I think the "glitch" relates to not hitting the = sign after doing the dividing. When it displays 0.72, it is only saying that 0.72 is 9% of 8. If you hit 8 / 9 and then =, it will display 0.8888889.

So, hitting "8" "/" "9" "%" is like saying "8 divided by 9% of 8".

danball1976
10 Jun 2003, 1:41am
Ok, but why doing the exact same thing on a regular calculator does something different?

dodo
10 Jun 2003, 1:52am
Its probably related to the order of operations that the calculator has coded into it. If this is the case, I dont know if either could be referred to as "correct."

~dodo

dodo
11 Jun 2003, 3:25am
wait...but the solution is the same when doing 8*9% and 8/9%, so it is still a bug, no?

~dodo

danball1976
11 Jun 2003, 3:44am
jdii1215 said
Um, RPN calculators enter in Reverse Polish Notation order. Algebraics use parentheses to tell what to calc first or work in entered order.
It is the diff between an old HP or TI calculator and a modern little four function credit card one. TIs usally used RPN. Most scientifics used RPN, less need to automaticly store intermediate results in RAM in calculator so less register RAM needed to calc a function, so cheaper to make.

Had you used 8/9=% or (8/9) % result should have worked right. It is a case of "does function type or strict left to right order" rule.

In this case, it looks like it did the percentage first, and that is RPN rules. Result: 8* .09 or 8*9% or 8/100/9 (<--this is how the calc thunk you wanted it to calc it using RPN rules)==8/11.1111.... ==.72 and thats how it calced it. GROAN. :banghead: :banghead:

Algebraic calc would get you percentage last. result .88 converted to % == 88.8888

Windows calc was coded to imitate the scientific Ti's which used RPN when it was first coded-- for Windows 3.11 or before(I saw an early version in a 3.1 OEM). Functions got added, core way of prioritizing never changed. Deliberate, not a bug.

Old-fashioned also, yes. ;) Sorry for the history lesson.

John Danielson
Why don't they update it then to todays standards

CyrixInstead
12 Jun 2003, 10:08am
Because the person using the calculator is expected to enter the sum correctly. You should do the 8/9, then take a percentage of that.

You don't just enter all the digits and expect the sum to come out correctly, you take note of the order in which operations occur i.e. * or / before + or -