Hacker News new | ask | show | jobs
by TheJoeMan 220 days ago
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)
2 comments

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.