Reverse Polish Notation (RPN) (postfix Notation)
In reverse Polish notation, also known as postfix notation, all operations are entered after the operands on which the operation is performed. Reverse Polish notation is parenthesis-free which usually leads to fewer button presses needed to perform an operation. By the use of stack one can enter formulas without the need to rearrange operands. An example of a calculator which uses RPN is the HP 48G.
Formula | Key strokes | Key stroke count |
---|---|---|
1 ↵ Enter 2 ↵ Enter 3 × + | 7 | |
3 0 SIN 3 0 COS × | 7 | |
5 ↵ Enter 3 - | 4 | |
1 5 ↵ Enter 1 0 + 1 0 + 1 0 + | 12 |
Note example 1 which is one of the few examples where reverse Polish notation does not use the fewest button presses – provided one does not rearrange operands. If one would do so then only 6 key strokes would be needed.
Read more about this topic: Calculator Input Methods
Famous quotes containing the words reverse and/or polish:
“We came home from the ridotto so late, or rather so early, that it was not possible for me to write. Indeed we did not go ... till past eleven oclock: but nobody does. A terrible reverse of the order of nature! We sleep with the sun, and wake with the moon.”
—Frances Burney (17521840)
“It has always been my practice to cast a long paragraph in a single mould, to try it by my ear, to deposit it in my memory, but to suspend the action of the pen till I had given the last polish to my work.”
—Edward Gibbon (17371794)