Re: Why RPN? Message #37 Posted by Norris on 28 May 2004, 12:40 a.m., in response to message #30 by A More Enlightened Student
One easy way to realize the advantages of RPN is to ask yourself a very simple question: what are the “rules” for using an algebraic calculator? For example, what actually happens when you press the + key?
Well, depending on the circumstances, pushing the + key can perform a wide variety of arithmetic operations. These include subtraction (example: 5 – 3 +), or multiplication (5 * 3 +), or division (5 / 3 +), or exponentiation (5 ^ 3 +). Sometimes the + key even performs addition (example: 5 + 3 +; the second push of the + key performs an addition, although the first does not).
In other circumstances, pushing the + key does not perform any arithmetic operation. It simply sets up a pending addition, which may be performed later when the = key is pressed (5 + 3 =), or in some cases by a right parentheses (5 + 3), or in some cases by a second push of the + key (5 + 3 +), or in some cases by the subtraction key (5 + 3 -). In other cases, subsequent presses of the right parentheses, + and – keys may not perform the pending addition, depending on the configuration of parentheses; for example 5 + (3 + 4 – 2) will not perform the first addition.
The same rules also apply to the – key. However, the rules are different for the * and / keys, and they are different again for the y^x key. Also, the rules may be different for unary operations like cos or log; on many algebraic calcs, unary operations are performed immediately, and are not affected by the = key, or by parentheses, or by any other operations.
Now read through all that again. Is it correct? Doesn’t it seem just a bit complicated when you think about it?
Now let’s consider the rules for an RPN calculator. They may be summarized as follows:
Pushing the + key immediately performs an addition. All other operator keys behave in the same way.
OK, that's it. Any questions? Would it be fair to suggest that the RPN rules are simpler?
Edited: 28 May 2004, 12:46 p.m. after one or more responses were posted
|