On Wed, Jun 18, 2025, 1:32 AM Jerome Shidel via Freedos-devel <
freedos-devel@lists.sourceforge.net> wrote:

>
> It looks interesting.
>
> But, I think I have know idea on how to use such a calculator.
>
> I tried entering “12-5” and got -7 as the answer. Probably me.
>
> ;^/
>


That is the correct result for an RPN calculator if you did what I think
you did.

RPN operates on a stack with operators. So to calculate "12-5" you'd enter:

12 <enter> 5 -

Typing "12 <enter>" puts the number 12 into the stack. Typing "5" puts the
number 5 into the stack as the next value. And typing "-" performs the
action to subtract the two values in the stack: the first number minus the
second number, or 12 minus 5, which gives 7.

But if you entered the numbers like you might in a standard calculator, you
probably entered:

12 - 5

And if you start with nothing (zero) in the stack, the "-" is the action,
so that's the same as "0-12" so now you have -12 in the stack. Entering the
"5" puts 5 on the stack, and if you happened to hit "+" after that (that's
what I think happened) then that adds the two values on the stack, which is
the same as "-12 + 5" which gives -7.


So you got the right answer for what you entered.

I'll add that RPN is not my preferred way to use a calculator, but I know a
few folks who love it so I've learned the basics of RPN just by osmosis.
:⁠-⁠)

>
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to