3 ms·
With postfix, numbers get pushed to the stack in the order you enter them and operators can be evaluated immediately. This way, intermediate results are always
by boomlinde 2y ago
With postfix, numbers get pushed to the stack in the order you enter them and operators can be evaluated immediately. This way, intermediate results are always naturally available as you type an expression. On a HP calculator you'd usually see the intermediate results on-screen, but in dc you type p at any point to print the current top-of-stack.
Prefix notation in its simplest form is essentially the same thing but backwards, and you would only get intermediate results if you start writing from the innermost expression, which is complicated by the fact that that expression doesn't appear in the order you normally type.