Reverse Polish Notation (Rpn); Rules For Rpn - Northern Telecom NAC User Manual

Network administration center
Hide thumbs Also See for NAC:
Table of Contents

Advertisement

7-50 Network Report Definition

Reverse Polish Notation (RPN)

Rules for RPN

P0724352 Standard 1.0
The Calculation field uses an engineering concept called "Reverse Polish
Notation," or "Stack Oriented Math."
Two simple rules exist for RPN equations.
An RPN equation is created by listing the values and math symbols
1
(operators) in a vertical line or stack. Enter the values and operators in
the equation in the order you want the values to be calculated. In an
equation you can add (+), subtract (–), multiply (*), and divide (/). The
operators are placed below the values you want to calculate. For
example, the equation 3+5 would appear in RPN as
3
5
+
The mathematical operators, +, –, *, and /, only work on the two
2
values that come before it in the stack.
If you want to add 3 and 5 and then divide by 4, you would write out
the equation on paper as (3+5)/4. The first calculation you want to
perform is the addition of 3 and 5, and then divide that total by 4. The
RPN equation would be entered as
3
5
+
4
/
The + operator adds the two values that come before it in the stack. In
this example, 5 and 3 are added for a total of 8. The stack then reads:
8
4
/
The / operator divides 8 by 4, for a final answer of 2.
November 1994

Advertisement

Table of Contents
loading

Table of Contents