RPN : Java Glossary

RPN
RPN (Reverse Polish Notation) is a simplified way of writing arithmetic expressions used in FORTH, Abundance and some Hewlett Packard calculators. In is named in honor of the Polish mathematician Jan Łukasiewicz There are no parentheses and there is no operator precedence. Evaluation is strictly left to right, all operands treated the same way. The operators follow the operands.

So
30 40 + 2 * 5 6 + /
means
( 30 + 40 ) * 2 / ( 5 + 6 )

The operands are pushed to stack and operations typically operate on the top two elements, replacing them with the result. Compilers have to convert conventional infix notation to RPN or something similar get clear on the order of execution. Internally the JVM (Java Virtual Machine) works with an RPN-like stack model and RPN-like stack operators.


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/rpn.html J:\mindprod\jgloss\rpn.html
logofeedback Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email If you want your message kept confidential, not considered for posting, please explicitly specify that.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.213]
You are visitor number 11.