RPN : Java Glossary


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.

30 40 + 2 * 5 6 + /
( 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.

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Canadian Mind Products

Your face IP:[]
You are visitor number