RPN is a form of expressing mathematical calculations through making good use of the
stack. You specify the
numbers first, then specify the
actions to be performed upon those numbers.
I.e., what normally would be written as "2 + 3 - 5" in
RPN would look like "2 3 + 5 -". It takes a while to sink in, but it becomes quite easy once you picture
how the stack works:
Operation:
2 3 + 5 -
Stack:
| | | | | | | | | |
| | |3 | | | |5 | | |
|2 | |2 | |5 | |5 | |0 |
---- ---- ---- ---- ----
The result of the operation is placed back into the stack and is ready for the next
operation. This continues until there's only one number left in the
stack.
That's really all there is to it.