Reverse Polish Notation

Newer infix calculators display the equation as you type it, which makes it much easier to catch this kind of problem.

Aside from fewer keystrokes, here is the TSD as I see it. If you have a formula that you have gotten from a book or derived somehow and you want to put numbers in and get an answer, then algebraic is what you want. If, on the other hand, you are reasoning out a problem as you go, then you will want RPN. Take a number <enter>, square it <x^2 key>, add your age <age +>, multiply by 7 <7 *>, etc. etc. It is the only way to do such a problem without writing down a formula first.

FWIW, my favorite programming language (back in the day) was Forth, solidly based on the same idea as RPN.

Just as an aside, I tried:

1+2*3 =

on windows calculator (Calc.exe, Vista, if it matters) program and got both 9 and 7. In standard mode I got 9, and in scientific mode I got 7 for the same keystrokes. Isn’t that interesting?

Regarding RPN: I love my HP (I have a 48S, but I really miss my 28S) and I think that RPN is the way to go…

I started with an HP15C on 04Apr83 for $112.32. I still have the calculator, but have moved on to a HP48. It might have been for pretension’s sake to start with the HPs, but after a quarter of freshman engineering, I would never go back. Speed is certainly a factor and HPs of that generation are bulletproof. Of all the HPs that I have had, only one has had contacts that have failed and this is after MANY years of use. I wish that they were that well built today.

On the other hand, after 25 years, RPN has changed the way I use calculators and I can not use AOS calculators without significant loss in speed and increased errors. The hard point for me is finding RPN calc programs for my computer.

I had an HP 15c in college, but lost it a few years ago. I wish I still had it or that HP still sold that model. I am seriously considering buying the HP 15c emulator for my iPhone. The only thing holding me back is that the app costs thirty bucks.

If I still used a calculator for anything more than trivial calculations, I would use RPN.

Of course, these days anything requiring repetition or a lot of entries goes right into a spreadsheet.

I love RPN and have used it on HPs for over 20 years.

RPN is to infix as Unix is to Windows.

The HP app skin looks like crap. If you don’t mind the layout change check out Free42.

I learned RPN while using an early Wang calculator back in the 60’s. Today if I’m forced to use a scientific calculator with all those equal signs and parenthesis it drives me bonkers. With just a little effort to learn it, RPN is so much easier. No screwed up parenthesis to worry about, lots fewer keystrokes (especially with complicated equations) and you can start calculating the result of an equation anywhere you want. If it turns you on to start with the middle of the denominator, go right ahead - just as easy as starting with the first term of the numerator.

Guess I’m misunderstanding “stack,” then. You still need to be able to store two numbers in order to do
a b +

What is the correct name for the “places” where the two numbers are stored?

The HP calculator stack consists of four “registers”, or storage locations. You can visualize it as four boxes stacked on top of each other. The display shows what’s in the X register, or bottom box. When you hit “enter” you “push” that value up the stack into the Y register. You enter the second value into the now-empty X register, then hit “+” and it adds the X and Y registers together, clears (or “pops”) the Y register, and shows the result of the addition in the display (X register).

Here’s a good demo page.

Thanks. I’ll check it out when I have the chance.

Do you miss playing with your Wang?

You folks nowadays don’t know what an unbelievable improvement things like the Wang calculators were over slide rules. And that is basically what they replaced. They took engineering calculations right out of the dark ages. They were WONDERFUL!!! I still get all warm and fuzzy thinking about them! I immediately developed a love affair with computers that exists to this day.

I remember well, back in the early 60’s when one of our engineers had to solve a simultaneous equation with SEVEN!!! unknowns, and do this with a mechanical calculator (known as a coffee grinder). It took him two days. After the first electronic calculators came in this became a five minute operation.

I think this is what the word “whippersnappers” was developed to describe.

I laughed like a madman for a good 15 minutes after figuring out how to program my 11C to do bubble-point and dew-point calculations (normally, a heinous process of iterative calculations).

Having tried to use my dad’s sliderule, I think I’d’ve gone into Liberal Arts, instead, if that was all I’d had to use. shudder

They are put in the same stack, which for old HP 12c is four numbers deep the newer ones listed on HP’s website has 20 registers (still one stack). Also the fact that all four positions are named is silly, since you only need one fixed position. X register is always the top of the stack, which means that whenever a number is entered every data value changes position. For the example that you posted it requires 3 positions in the stack. You can determine the number of positions required for a calculation by counting the maximum number of sequential operations and adding one; a b + c d + * e f + / requires three for + * and + /.

Although I would be hard pressed to find a calculation that requires more than 20 consecutive operations, the design of these calculators seems primitive and limiting. My TI-83 has (32k actual) 24k available which would translate to about 3000 64-bit registers.
And it would be faster since the 12C runs at 200khz and the 83 runs at 15000khz.

I’m a bit at sea regarding ‘stacks’.

Think of a stack of plates. You can only add a plate to the top of the stack or take off the top plate. Putting a plate on top of the stack is called a push, taking a plate off the top of the stack is called a pop. Now imagine that instead of a tasteful floral pattern the plates have numbers written on them.

Your stack starts out looking like this (Empty):


This line is the table which the stack of plates will rest on.

Take the following calculation 1 2 3 + +, to perform this in a stack based fashion you would put the plate marked 1 on the table (push).
Your stack looks like this:

[1]

Then put a plate marked 2 on top of the plate marked 1 (push), then take the plate marked 3 and put it on top of the plate marked 2. your stack looks like this:

[3]

Note: you can only see the number on the top plate since the other plates are covered.

Now you come to a + this means that you take the plate marked 3 off the stack (pop) and the plate marked 2 off the stack (pop) and figure out what 2+3 is, since it is 5 you will put a plate marked 5.

Now your stack looks like this:

[5]

Then you come to another + so you take the 5 plate off the stack and the 1 plate off the stack and figure out what 1+5 is, since it is 6 you put a plate marked 6 on the stack.
[6]

Since you have run out input, you examine the top plate, 6 and that is the result.

When I first saw it, I was thinking more like ripples in a pond. Work the inner ones first and work outward.

Thanks for the replies and opinions so far. I haven’t had time to look at yoyodyne’s demo page, but hope to this weekend.