Rpn Base Calculator Issue
Posted 10 February 2005 - 07:29 PM
I've noticed such a thing in the RPN Base Calculator:
When I want to calculate 10/5 for example and I press: 1' /> EXE' /> 5' /> I get 0.5. It calculates the other way round. It should take the first number I've typed in and divide it by the second, but instead it takes the number highest in the stack and divide it by the second in the stack. I know that RPN Base Calculator is mainly for Base conversions and few people use the Reverse Polish Notation, but I think it's a major issue I describe here. If you actually wanted to use it for operations you would get inverted division results. Perhaps the input line could've been at the bottom and the stack would fill upwards.
Posted 16 February 2005 - 05:59 PM
it would take the last number pushed on to the stack as the first parameter to the operation applied, ie 10 5 / -> .5
Posted 17 February 2005 - 03:19 PM
Posted 18 February 2005 - 11:03 AM
10 ent 5 /
it gives 2.
Same with substraction:
5 ent 3 -
gives 2, while CP gives -2.
When you input 10 ent 5 / this means: 10/5 and the answer should be 2 not 0.5 as CP says. Classpad does it in reverse. It's not how the RPN works.
Posted 19 February 2005 - 04:55 PM
From a programming perspective it just seemed more natural, maybe that's the cause of the error as well
Posted 19 February 2005 - 06:19 PM
Yes, I agree.
From a programming perspective it just seemed more natural
But It's rather illogical when it comes to doing math operations on a calculator.
Perhaps if the stack was pushed upwards it would be more natural as for RPN.
I think that the error may be very simple - maybe a simple swapping of the input line variable with the stack's first position variable in the code where the math is being done could do it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users