Reverse Polish Notation (RPN)

What is Reverse Polish Notation (RPN)?

Reverse polish notation, or RPN, is one of the three commonly used calculation notations. The other two are polish notation and infix notation. The latter, infix notation, is the one most commonly used across the world and is probably the form of notation that is most familiar to readers. Infix notation is the standard taught in schools, with the operator placed “in” the formula. For example, to show the calculation 10 plus 5, infix notation is written as 10 + 5.

In contrast, the polish and reverse polish notations place the operator on either side of the numbers. Polish notation would note the above calculation as + 10 5. Reverse polish notation is simply the opposite of that, with the operator appearing after the numbers. The infix notation formula of 10 + 5 is noted as 10 5 + in RPN.

Financial analystsGuide to Becoming a Financial AnalystHow to become a financial analyst. Follow CFI's guide on networking, resume, interviews, financial modeling skills and more. We've helped thousands of people become financial analysts over the years and know precisely what it takes. may use RPN calculators such as the HP 12CHP 12C CalculatorThe HP 12C calculator is a financial calculator in the fields of banking and investing and it uses reverse polish notation. The HP 12C Calculator is a financial calculator produced by Hewlett Packard and is widely known as the gold standard for calculators used in the banking and financial services industry.

RPN Calculator (Source: Wikipedia.com)

Why use RPN?

At first glance, reverse polish notation may seem rather complicated or confusing, but it is actually a rather intuitive notation. When performing RPN calculations, the user follows the logical flow of the calculation. In contrast, infix notation requires the user to input a formula or calculation from left to right, regardless of whether the calculation is performed in that order.

One of the gold standard calculators used in the field of banking is the HP 12C calculator. This calculator uses reverse polish notation and is widely lauded for its efficiency and intuitiveness.

Example of an RPN Calculation

Assume a user is calculating the future value of $1,000 deposited today over the course of the next five years. In the first year, it will only earn 2%, but in years two and three, it will earn 5% each year, before reverting back to 2% for the last two years.

The formula to find the future value is:

FV = 1,000 x (1 + 0.02) x (1 + 0.05)^2 x (1 + 0.02)^2

In a traditional infix calculator, the simplest way to enter this function would be:

With a reverse polish notation calculator, the simplest way to enter this function would be:

1000 [ENTER] 1.02 [X] 1.05 [ENTER] 2 [yx] [X] 1.02 [ENTER] 2 [yx] [X]

The RPN calculator uses 3 fewer strokes than the infix calculator, which saves time and is more efficient in the long run. Additionally, the user must remember the stack of parentheses applied in the infix calculator, which can become burdensome for longer calculations. An RPN calculator can perform parenthetical functions retroactively.

Additional Resources

Thank you for reading this guide to RPN and how to make your complex calculations more efficient. For more financial analyst tools and training, please check out these additional resources:

HP 12C GuideHP 12C CalculatorThe HP 12C calculator is a financial calculator in the fields of banking and investing and it uses reverse polish notation. The HP 12C Calculator is a financial calculator produced by Hewlett Packard and is widely known as the gold standard for calculators used in the banking and financial services industry

Decimal Function in ExcelDECIMAL FunctionThe DECIMAL function in Excel is a Math and Trigonometry function. It is used for converting a text representation of a number in a stated base into a decimal value. The function was introduced in MS Excel 2013.

Financial Analyst Certification

Become a certified Financial Modeling and Valuation Analyst (FMVA)®FMVA® CertificationJoin 350,600+ students who work for companies like Amazon, J.P. Morgan, and Ferrari by completing CFI’s online financial modeling classes and training program!