Hi all,
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.
Regards
Rpn Base Calculator Issue
Started by
m4x
, Feb 10 2005 07:29 PM
5 replies to this topic
#1
Posted 10 February 2005 - 07:29 PM
#2
Posted 16 February 2005 - 05:59 PM
looks like the correct behaviour for an rpn calculator to me..
it would take the last number pushed on to the stack as the first parameter to the operation applied, ie 10 5 / -> .5
it would take the last number pushed on to the stack as the first parameter to the operation applied, ie 10 5 / -> .5
#3
Posted 17 February 2005 - 03:19 PM
2 is the correct answer not 0.5, you did something wrong. maybe 5 enter 10 /
#4
Posted 18 February 2005 - 11:03 AM
I've got another calculator which has RPN and when I input
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.
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.
#5
Posted 19 February 2005 - 04:55 PM
I stand corrected.
From a programming perspective it just seemed more natural, maybe that's the cause of the error as well
From a programming perspective it just seemed more natural, maybe that's the cause of the error as well
#6
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