reverse Polish notation
Whereas operators are traditionally placed between operands, with parentheses used to override operator precedence, it is possible to place operators to the right of operands, thus eliminating ambiguity and the need for parentheses, and even the need for rules of operator precedence. This is known as reverse Polish notation (after the Polish mathematician Jan Łukasiewicz who came up with Polish notation, abbreviated RPN), or postfix notation. Invented by Australian philosopher Charles Hamblin, reverse Polish notation requires that the number of operands of a given operator be defined in advance.
For example, probably means 47, but if the possibility exists that the author meant but neglected to put in parentheses, the expression could actually mean . In reverse Polish notation, we could define the basic arithmetic operators to all be binary, and write with the confidence that it will evaluate to 47 and not 45.
Reverse Polish notation is particularly advantageous for stack-based programming languages like Forth and Adobe PostScript. Most Hewlett-Packard calculators use reverse Polish notation (though a few, such as the HP-38G, use the sort of infix notation conventional to most calculators). Some beginning programming language courses give as an exercise to the student the implementation of an RPN calculator. Instead of having to remember multiple addresses for different variables and constants, most RPN implementations use a stack and a stack pointer to keep track of data.
|Title||reverse Polish notation|
|Date of creation||2013-03-22 16:10:04|
|Last modified on||2013-03-22 16:10:04|
|Last modified by||Mravinci (12996)|