Hacker News new | ask | show | jobs
by _verandaguy 227 days ago
Maybe it's a generational thing -- I haven't had to use a standalone calculator in my professional life -- but what's the benefit of using RPN as opposed to the more common infix notation?

Beyond that... do RPN calculators like these usually include the option to use infix notation?

4 comments

It eliminates the need for parentheses and operator precedence, which is honestly nearly half of the character count of my usual infix math. You can just keep performing new calculations and then later on decide how you want to combine them. It's pretty great.
The iPhone calculator, for example, only recently added parenthesis. However, with prefix notation you have to plan out your open parenthesis, and if you forgot one you have to back up. With postfix, the parenthesis are implicit. Which is faster? “2 2 + 2 x” or “2 + 2 = x 2 =“ for 2(2+2)
On a basic four-function calculator, you can do "2 + 2 x 2 =" to get 8 without the extra = in the middle. RPN really shines when you use the stack for real. "(2 + 3) x (4 + 5)" is "2 3 + 4 5 + x" in RPN, but on a four-function this requires the stateful memory buttons and gets out of control fast. You may need to spill out to pen-and-paper with a four-function calculator, but you never need that with RPN. I'm less certain that the comparison works out in RPN's favor if you have a calculator with parentheses--where are you getting the complex expression that you're entering? If it's on paper, then it's already in infix notation and you had to mentally convert it to RPN inside-out. Entering the infix notation may be more keystrokes but likely less mental effort because it's more of a direct transcription. I taught a sibling how to use an HP-12C and I don't think they're ever gaining that time back in efficiency.
Way back around ‘84 in the military I was doing the artillery survey calculations for the Lance (potentially nuclear) missile. We had to store first the program into the volatile hp memory, run check calculations before doing the real calculations. I always found the calculations very efficient - they had to be as they had to be done within certain time limits (and independently checked). It was a strange feeling thinking about doing the calculations under high pressure and what the stakes were if you would get the coordinates or directions wrong in case it would be used.
Beyond the fast entry (no parentheses), I like RPN because I find it a more intuitive way of working with numbers.

I do not need to think about my operation before I start inputting numbers. I can type in the numbers I'll need, and while seeing them I run operations on them.

I have an HP50G that lets you switch to infix notation, but for most operations RPN is faster due to fewer keystrokes.

Like many others here, I rarely use my calculator any more. My phone is just so much more powerful with a lisp REPL and python.

This is cool technology, though.