| RPN
Calculators -- the
Short Version
RPN
Calculators -- the
Short Version
RPN stands for
"Reverse Polish
Notation," a
parenthesis-free
method for
performing
calculations. In the
United States this
method has been
popularized by the Hewlett-Packard
Corporation1,
which sells a line
of RPN calculators.
The method depends
on a stack of values
as its organizing
principle. When a
number is entered,
the previous entry
is "raised"
in the stack, so
that several values
can be stored. When
a mathematical
operation is
performed, it is
performed on the
most recent value (or
values, if more than
one is required).
For
example, to divide
80 by 81, you make
these entries:
80
[Enter]
81
/
At
first, this method
may seem cumbersome,
but in time one
begins to see its
great value -- one
need never worry
about algebraic
order of precedence,
because the order in
which operations are
performed is
entirely controlled
by the order in
which the values are
entered and the
operations performed.
On
some problems, the
algebraic order of
precedence can be
depended on to
provide the correct
result. But many
problems are
difficult to state
using the default
precedence. In this
next example, you
want to multiply the
result of two
additions ((a + b )
* (c + d)). If you
simply enter this
problem into an
algebraic calculator,
you will get a + (b
* c) + d, not (a +
b) * (c + d), as you
expected, because
multiplications are
performed before
additions.
In
order to solve this
problem on an
algebraic calculator,
you must carefully
place parentheses
between the
operations (assuming
your calculator has
parentheses). But in
RPN notation, the
problem is simple to
solve:
a
(vaue)
[Enter]
b (value)
+
c (value)
[Enter]
d (value)
+
*
Once
you begin to get a
feel for RPN, you
will realize it is
the easiest way to
solve all but the
simplest problems. You
never have to press
more keys than on an
algebraic calculator,
and you often press
far fewer. |