5 ms·
> The magic is the automatic saving of subexpressions on a stack. Once you got the hang of it, you would never want to go back to an infix calculator I was one
by hota_mazi 9y ago
> The magic is the automatic saving of subexpressions on a stack. Once you got the hang of it, you would never want to go back to an infix calculator
I was one of these smug HP calculator owners back in high school and college. I loved it and spent hours hacking on it (and also secretly enjoyed the fact that nobody borrowed it since hardly anyone knew how to use it).
Years later, I started realizing that the reason why these calculators do take fewer keypresses to make calculations is because they borrow your brain to assist them.
For example, you see `3 * (2 + 4)` and your brain has to identify the most nested parenthesis expression, type that in and work your way out. It works well enough for simple expressions but doesn't really scale very far beyond that.
Remember this SETI program that used people's idle CPU's to scan sky pictures? I felt HP calculators had been pulling the same trick by borrowing your brain to calculate their expressions.
I felt that I had been cheated but I wasn't really mad about it because I loved these calculators so much.
- ScottBurson 9y agoI don't think that's fair. Either form requires some mental stack space to convert to the other form. It's just that people are more used to reading and writing infix.
- dm319 9y agoYes, I find complex equations to be far easier to calculate in RPN. Even if you get stuck you have a useful intermediate. On algebraic I find I'm having to back pedal to sort out parentheses for lower order operators.
- antod 9y agoAgreed. Although getting a multiline display like the 42S or (gasp) 48S helped a lot with keeping track of the stack. edit: 42S not 42C
- hota_mazi 9y agoFor regular notation, you just type all the characters as you read them, including parentheses. This requires less mental activity on the person, as opposed to RPN, which forces you to first parse the entire expression and identify the most nested expression and process outward from that point on.
- grzm 9y agoAnecdote, but I was surprised to find that my father (who used his HP with RPN extensively) found "normal" calculators more difficult to use. At the end of the day I think it comes down to what you're used to. Requiring more or less mental activity can come down to how closely the activity matches what one is comfortable with.
- xelxebar 9y agoI'm not sure about the 41C, but I have a 32SII and you don't need to process "from the inside out". When you encounter an open parenthesis, then you just push the following number onto the stack, when you encounter a close parenthesis, you just perform the relevant arithmetic operation. For the example 2 * (3 + 4) we can do this Input Stack 2 2 3 3,2 4 4,3,2 + 7,2 * 14
- hota_mazi 9y agoIt works here because the expression is simple. You only have four variables on the stack (maybe more in later models that I'm not aware of) and for those, you are screwed if you just push things on the stack in reading order: 2 * (3 + (4 + (5 + (6 + 7)) The only way to process this is to determine the most nested expression and start there: 6 7 + 5 + 4 + 3 + 2 * ... you get the idea. Expand this expression with multiple deeply nested parens and the limitations of RPN become very obvious.
- ScottBurson 9y agoI'm pretty sure the more recent, higher-end RPN calculators have lots more than 4 stack slots. 4 is usually enough in practice anyway. Your example is artificial. Besides, are you sure your infix calculator will accept this deep a nesting of parentheses? The TI models that were contemporary with the early HPs certainly wouldn't!