(a constant gets pushed onto the stack. functions like "power" and "+" operate on the stack)
So this also works:
2 30 2 power +
Although I don't really use it anymore, my calculator (an HP scientific calculator) also uses reverse polish notation, so you can keep intermediate values on the stack, and do complex calculations without using parentheses at all. This is also good for keeping people from asking to borrow your calculator in math class. :)
What is the syntax that you posted? It looks just like RPN in reverse. Ok, that was a stupid question. I just figured out that is just "polish notation." It must keep a stack of operations that don't have their operands yet.
So this also works:
Although I don't really use it anymore, my calculator (an HP scientific calculator) also uses reverse polish notation, so you can keep intermediate values on the stack, and do complex calculations without using parentheses at all. This is also good for keeping people from asking to borrow your calculator in math class. :)What is the syntax that you posted? It looks just like RPN in reverse. Ok, that was a stupid question. I just figured out that is just "polish notation." It must keep a stack of operations that don't have their operands yet.