Exercises
To get the hang of using esc and Reverse Polish Notation, here are a few simple exercises you can work through. Click the footnote link to show the answer.
Questions
Calculate the answers to the following algebraic expressions:
\(2 + 5\) [1]
\(17 / 5\) [2]
\(\frac{30}{3 \cdot 5}\) [3]
\(60(2 \cdot (17 + 8))(5 \cdot 3)\) [4]
\(\frac{12 + 6}{18 \mod 3}\) [5]
\(\frac{1.52 \times 10^3}{12^{-2}}\) [6]
Enter the numbers listed in the left column into the stack, then manipulate it using arithmetic or stack operations or registers to match the right column. You cannot enter any new numbers by typing them.
Answer |
Initial stack |
Final stack |
|---|---|---|
5
3
|
3
5
|
|
1
2
3
|
(empty) |
|
1
2
3
|
3
1
2
|
|
1
2
8
|
11
16
8
|
Answers
There are an infinite number of possible entry sequences that would work for every question. The sequence or sequences shown here are just some sensible choices; obviously, the most important thing is that you have the right answer.
In many cases, you’ll have a choice between entering the numbers in strict order as they come in the expression or working from the inner parentheses out, or some combination thereof. This is largely a matter of taste; RPN old hands are more likely to work from the inside out since hardware-based RPN calculators have a limited number of stack entries and one might run out of stack space when working strictly left-to-right, but esc has no stack size limit.
Note
Keystroke sequences are rendered with spaces between operations for readability here. Many of these spaces are not necessary when typing into esc or will even give the error “No number to finish adding”.