The best rummage sale purchase I ever made was a piece of hardware that used Reverse Polish Notation. I know what you’re thinking… RPN sounds like a sales gimmick and I got taken for a fool. But I assure you it’s not only real, but a true gem in the evolution of computing.
Sometime in the 1980s when I was a spotty teen, I picked up a calculator at a rummage sale. Protected by a smart plastic case, it was a pretty good condition Sinclair Scientific that turned out when I got it home to have 1975 date codes on its chips, and since anything with a Sinclair badge was worth having it became mine for a trifling amount of money. It had a set of corroded batteries that had damaged one of its terminals, but with the application of a bit of copper strip I had a working calculator.
And what a calculator! It didn’t have many buttons at a time when you judged how cool a scientific calculator was by the prolific nature of its keyboard. This one looked more akin to a run-of-the-mill arithmetic calculator, but had button modes for trigonometric functions and oddly an enter key rather than an equals sign. The handy sticker inside the case explained the mystery, this machine used so-called Reverse Polish Notation, or RPN. It spent several years on my bench before being reverently placed in a storage box of Sinclair curios which I’ve spent half a day turning the house over to find as I write this article.
I was reminded of my Sinclair Scientific recently when I read a Hackaday comment which introduced the inventor of RPN, Jan Łukasiewicz, as an engineer rather than a mathematician. I had not previously encountered him so this opened up a fascinating exploration of his work, plus a revisiting of RPN as an adult rather than as a soldering-iron-wielding teen. Simply put, RPN is a specific method of writing math equations that is still human while being suitable for input into a computer with limited memory.
The first thing to learn about RPN is that the “Polish” part comes from Łukasiewicz’s nationality. Perhaps we Anglophones should put in a bit of effort to learn how to pronounce his name. Then the second lesson is that the “Reverse” part is important, but a smokescreen that relates only to the direction in which it is written. Write the expression one way round and it’s Polish notation, the other way and it’s Reverse Polish notation.
The feature which makes PN and RPN special is that the operator does not come between operands, but follows them. So for example, where you might be used to writing 2+2=
to get 4, in PN you would write + 2 2
, and in RPN you would write 2 2 +
.
[Łukasiewicz] was a logician, and his notation was designed with the purpose of removing parentheses when each function has a constant number of arguments. Thus, we’re used to writing (2+2)*3
to get 12. In PN we write * + 2 2 3
or * 3 + 2 2
, and in RPN we write 2 2 + 3 *
or 3 2 2 + *
. (The latter versions work b/c multiplication is commutative.)
PN and RPN might be one of those slightly interesting mathematical factoids some of us in our community have heard about in passing some time in our education. But in fact is it much less obscure than that because RPN has a very useful property. It lends itself to use with a stack, to perform calculations. The operands and operator are in effect ready lined-up to be to be distinguished from each other by their order of precedence, meaning that a device such as a calculator could be produced more easily using RPN than conventional notation. While those of us who still use a physical calculator are used to conventional notation as an input, some earlier calculators used RPN to do more with less.
Which brings us back to my Sinclair Scientific mentioned above. When people think of an RPN calculator, it’s likely that they’ll single out Hewlett-Packard as a manufacturer. You can still buy an HP that uses RPN, and indeed not so long ago their adherence to RPN was considered a significant selling point by HP. But the Sinclair is a little different. Clive Sinclair always made a speciality of extracting the maximum performance from the minimum of components to deliver the lowest price, even if sometimes the quality or utility of his products suffered as a result.
This calculator then is a Sinclair product at its finest, featuring a cheap arithmetic calculator chip from Texas Instruments, the TMS0805, coaxed into offering trigonometric and logarithmic functions by some astounding coding from Sinclair employee Nigel Searle. The result was a single chip∗ scientific calculator at a fraction of the cost of those from TI or HP, but with the penalty of reduced speed and floating-point accuracy. We covered [Ken Shirriff]’s reverse engineering of a Sinclair Scientific a few years ago, even today it’s an intriguing machine.
In use it’s a frustrating exercise in learning RPN again on the fly, that turns into something close to a mathematical puzzle as the minutes tick by and that LED display drinks power from its 4 AAA batteries. That would have been no laughing matter in 1975, as a set of 4 alkaline AAAs would have been considerably more expensive in real terms than they are now. Once you are in the RPN Zone it really is extremely logical and easy to use, but the same can’t quite be said for the Sinclair. A complex sequence of keys is required for most of its functions, meaning that its novelty wears off after a while. Still, with early ’70s design aesthetic, at least it’s quite attractive to look at.
∗ Technically the Cambridge has 3 chips, the TMS0805 and a couple of display drivers. But they’re ancillary to the processor, and the HP calculator at the time used a 5-part processor chipset.
HP9100A image, the first Hewlett-Packard calculator to use RPN, Rama, [CC BY-SA 2.0].
Nice thing about RPN. Only one person ever borrowed my calculator. :-)
+1
I went from sweet little decimal trig log-log slide rule to a TI-10, but once I got my HP-25 I never looked back. After the 25 died from an unfortunately under designed power supply I reluctantly moved to the HP-48. I’ve since bought every HP RPN calculator I’ve found at a garage sale as a backup.
Going from the TI-10 to the HP-25 I loved being able to immediately start in on the equation I was trying to solve. The TI took about as much pre-work time as it took to solve the equation using the HP-25. I have an emulator on my phone now of both the 25 and 48 but still love the feel of the keypad on the originals.
I foolishly wrecked my HP-25 when I tried to power with the wrong voltage. (12volts?)
It had corroded NiCDs.
I had bought it at Goodwill for $0.25
I wonder what “+1” may mean in this thread… ;-)
1++
oops, should have said simply ++
No! “++” adds the lowest 3 stack levels together. It must be “1 +”.
Btw. I have a very old HP from my father, which unfortunately used it’s NiCds to buffer and regulate the power (with corrosion problem) and a HP48. But I mostly use the 48 emulator on my phone, because I have it with me anyway.
Please refrain from incrementing numerical constants which other people may be using
Too late, now pi equals 7639.1415926
DUP 1- –
In 1972, I was going to Rice University.One day I got to a Physics test only to realize I’d forgotten my calculator. I saw the TA proctoring the test had a calculator pouch on his belt, so I asked him if I could borrow it for the test. “Sure”, he replied, with a smile and handed it to me. I wondered what he was smirking about. I soon discovered that his calculator was a just-released HP-35 – an RPN calculator, at a time when no one (including me) was familiar with it. I did…poorly…on that test.
same thing happened to me, but I figured it out and still got a B+
“calculator pouch on belt”
somehow amazing
Went well with the pocket protectors nerds were sporting. :-)
“were” sporting? I still wear one when I have a dress shirt to protect. It says “Nerd Pride” on it.
I had an HP41c belt pouch :) helt the calculator and its magnetic card reader !!!!!
Anybody remember “synthetic programming”?
Oh yeah – fun times. I was in school at Oregon State University and the HP calculator division was right outside of town. There was a *very* active HP calculator community there and synthetic programming was part of the lore. I had a 41CV and the optical wand – I could code synthetic instructions by drawing them on paper with a sharpie and swiping them in. I still have a thick book of HP calculator tricks squirreled away somewhere that the club there published.
Well you were lucky lol.
We didn’t have calculators so we had to remember sin/log tables and we had to get test questions right to three decimal places.
My version of the story:
Circa 1975, I had a new HP45, and while I had the RPN under control, I had not anticipated the effects of the stack being only four deep. Consequently, on a electronics circuits exam, I did rather poorly. The next day, I visited the professor and explained what I thought had happened, hoping that he’d realize I wasn’t a complete idiot and would do better on future exams.
Later, when he handed out the exams, he commented on the large number of failing grades, and the parade of excuses he’d heard for them. But he recounted specifically, to the rest of the class, “a student confused by his own calculator”. My friends knew who he was referring to. What a fucking asshole, I thought.
A fellow student pointed out to him that the large number of failing students might have more to say about his teaching abilities and his own abysmal textbook that we were forced to use. On the first day of class the professor handed out several dozen pages of errata. 40 as I recall (not errors, 40 PAGES of errors). Quite literally each page of the book had several significant errors.
Regardless, I wasn’t the only one that pegged the professor as a dumb-fuck. He failed to make tenure, and moved on a few years later.
(Me? After my MSEE, I went on to work for HP for two decades. While at HP Labs, I encountered several of those who had worked on the HP35 and HP9100. I learned many fascinating details about those products.)
My batteries died right before a high school chem exam, asked my teacher for a loaner calculator. Watched as she dug through to the bottom of the drawer, only to apologize that there were no more calculators. Asked her to loan me one of the slide rules that I’d seen in the drawer while she was digging. She thought I was joking, had to convince her I wasn’t. Test worked out pretty well.
I had a fancy graphics calc, took 3xCR2032 and they weren’t quite so ubiquitous those days. They were getting weak, so with exams coming up, I bought a new set from the radioshack and put them in the morning before the exam… flipped calc on, seemed good, get into applied mechanics exam, first problem, damn, screen dimming rapidly, start second, can’t see crap… aaargh, thankfully the “old” batteries I had just dropped in my pencil case, and with that and some geometry implements, was able to get calc open, swap in “old” batteries and finish exam with them… so yah, later that afternoon I’m back at radioshack giving them hell for stale batteries, and they act all dumb and just want to give me more off same rack, I say test them in front of me, they’re all down at 2V or so…. finally they refund me…
When I went to college (mid-80’s), I bought an HP calculator for two reasons. The first was that I was a FORTH fanatic and so RPN was natural for me. The second reason is few people would ask to borrow my calculator.
You had a calculator? I had a Pickett. Never once had a battery problem. Still have it in it’s hard case with belt loop.
Two in my case. But the second hadn’t asked and didn’t give back )-:
In school days I didn’t have enough money to buy a scientific calculator, so I promptly learned RPN and then I could borrow calculators from any of my colleagues :)
Love my HP12Cs. I love the strange looks I get when trying to teach someone how to use RPN. Maybe someday I will succeed in passing on the love.
In 1986, after 10 years of agony with lousy Ti quality (this time it was double hits on many of the keys) I bit the cost and RPN learning curve bullets and bought an HP-15C. I never went back.
Separately, and to the slide rule fashion comment elsewhere in this thread, my first and only was the Post for which I searched high and low because (1) it was bamboo and (2) it came with a wonderful, plain grey plastic case with no belt loop! Forty-eight years later I break it out now and again for old times sake. it still slips like brand new!
I once failed a chemistry test in collage because on the day of the test our professor told us to put away our calculators and proceeded to hand out a set of TI graphing calculators. I was so used to using RPN calculators that I kept getting the wrong answers to my calculations. Since my math & equations were correct (except where I used the calculator) she let me re-do the math and I went from a failing grade to an almost perfect one.
I learned electronics on a RPN calculator in highschool, we all used emulators for the HP-42s. Our teacher argued it was the best calculator ever made for finding resonance.
I’ve been using the emulator on every computer and phone ever since. Works pretty good for complex numbers.
Ahem, still in use today….
apt-get install x48
I think it teaches the concept of the stack very nicely
;)
“Unable to locate package x48”
https://packages.gentoo.org/packages/app-emulation/x48
https://sourceforge.net/projects/x48.berlios/
#You may have to compile x48 v6.4 tarball
sudo apt install xutils-dev
cd ~/x48-0.6.4
./autogen.sh
./configure –with-x
debuild -uc -us -tc
sudo dpkg -i ../x48_0.6.4_amd64.deb
cp -r ~/x48-0.6.4/REPO/.hp48 ~/
#mkcard 4M ~/.hp48/port1
x48 -initialize
#boot the GX ROM HP released into the public domain
x48
No. Something (in German) like “apt-get” not found or misspelled.Possibly because this is a Windows machine :-)
“apt-get install x48” gives an error message. Luckily I have Excalibur 32, which is an RPN calculator for Windows already installed. :-) And the 48 emulator on the phone (android).
Certainly does. No way I would have fully understood what a stack was without being shown how to use a RPN calculator by an early Math teacher. Didn’t like it compared to ordinary calculators but was still really cool.
Funny, I got a 42S in 1991 or 1992 and it’s the only electronics I own that has gradually *appreciated* in value. I never would have guessed that it would become THE reference RPN calculator from HP’s “good old days.” I got hooked on RPN with a 11C my HP-employed cousin gave me in the mid ’80s, so when I wanted something more powerful when in engineering school, the 42S was the obvious pick at the time.
Re: RPN, it ruined “regular” calculators for me: they make no sense at all! I can’t run a long calculation on them to save my life. Good thing there are HP calculator emulators all over the place :)
p.s. I still use my 11C and 42S all the time, they’re so well built and the buttons still feel *just* *right* after all these years.
The buttons are what sold me the HP-25.
Back in the day, the TI calculators were known for sh*t buttons, and the HP ones for very high quality buttons.
Calculators were expensive in my days as just coming out. $90 for a used calculator in ’76 broke me for over a week. When discovered it was RPN felt had been taken but got used to it quickly. So fast for ALL of electronics! No more stop and scribble on scratch pad. Packed up the sliderule Dad used to teach me electronics and mailed it back to him.
When done and ready to ship out sold it to a new student for $90… but was mindful enough to spend a while teaching it to him.
That HP-9100 picture brings back memories. That was the first computer I ever touched. We had an after-school computer class in about 1971, and that was one of the machines we learned to program.
I still use RPN, but my weapon of choice now is the HP-42S.
That’s my holy grail. I have over a hundred vintage calculators, including at least 40 desktop models. My favorites are my Sony Sobax ICC-600W that I fully restored, my SMC Cogito 240 SR,, My Remington 1259S, My Friden EC-132, my Commodore 512, and my Wang 360SE… I have Soviet calculators, I have discrete component calculators, I have small scale integrated circuit calculators… My Sony is even a hybrid module calculator! While I don’t own a full Anita tube calculator, I do own 6 of the decade counter/nixie display boards from an Anita Mk-7 that I hope to make live again in a custom build (It will be a simple adding machine that uses miniature rotary phone dials as numeric inputs).
Still, the one machine I have yet to encounter is the HP9100 (A or B… I ain’t picky). A full scientific calculator, done in resistor-diode logic, with a spattering of transistors, and an incredible 32 Kbit microcode ROM implemented with nothing more than zigs and zags of traces across a 16 layer teflon insulated PC board… Sort of a fixed state inductive “core” like memory… Incredible engineering, and still in such a small footprint for it’s capabilities! The ability to attach accessories, like a point digitizer, or an X-Y pen plotter… Effectively made it a graphing calculator with no digital chips in it! (It technically had four op-amp chips in the magnetic card reader, but those were analog circuits)…
If only I could afford one. ;_;
*SCM Cogito 240 SR (not SMC) – I’ll blame my typo on a long work day. :P
I love “cryptic” ways of solving things. RPN shows up in useful places like putting math formulas into command line arguments.
It is what compilers do to infix formulas before converting to code.
Interesting! I never knew Sinclair made RPN calculators.
One note: the Polish notation expression should be * + 2 2 3, right?
I thought it was more like “I thought only HP made RPN pocket calculators”.
But that’s not fair, National Semiconductor had a scientific calculator around 1974, I guess it was, and it used RPN. Beyond those three, I can’t think of others back then that did RPN.
Michael
Here is another one,
B^)
https://en.wikipedia.org/wiki/Elektronika_MK-61
I’m pretty sure I’m responsible for messing that up — you’re right. It could also be * 3 + 2 2. Which is more legible? I’m going with neither. My brain hurts.
Thanks. Will fix.
:)
The Sinclair Scientific and Scientific Progrmmable did use RPN, but only with an effective 2-level stack!
I have an HP-25 (still working!) and an HP-41C, also working. I run a 41C emulator on Linux, Windows and my iPhone.
I spent the time to learn RPN in college, and I find it much more intuitive.
And, yes, I can also use a slide rule. I got my first calculator, a Sears-branded Bowmar 4-banger, at Christmas, 1972. It lasted me through college, then I got the HP-25 when I started grad school.
Should have mentioned forth :-)
+1 I have a great book by Jon E. Ball, “Algorithms for RPN Calculators”, 1978. I bought it when it was new. An amazing work with everything from vector algebra to Bessel functions. He was big on counting number of saved key strokes. The strangest part is that the algorithms are described by a transcription of keystrokes! This made using the book as a reference for Forth a meticulous process of translation. IIRC, he did versions for HP35/45 and a versions for HP65, which had more storage cells, more program steps, and could read a little magnetic strip on which you could save programs.
I think the HP calculators did trig and other functions using the CORDIC algorithm, and CORDIC was then used by a lot of RPN and Forth based systems
RPN is a good gateway to stack-based languages such as Forth and PostScript
The first handheld calculator I ever saw was an HP belonging to a good friend. It used RPN and I learned how to use it. It makes sense: the calculator cannot add until it has two numbers so why would you press + before it has both numbers?
Having learned RPN made it easy to catch on to Forth, which I learned about from the August 1980 issue of BYTE magazine. I sent off for the Fig-Forth listing for 8080 and typed in the Assembly code using Z80 mnemonics on a TRS-80 Model 2. Once it assembled and ran, I optimized the code for Z80 and it ran faster.
Arcane and eldritch text I conjure thee from the depths of tiiiiime….
https://archive.org/details/byte-magazine-1980-08
The YouTube link for the pronunciation gives a plausible American pronunciation that (of course) does not correspond at all to the Polish pronunciation. A better version, spoken by real Poles, might be found here: https://forvo.com/word/jan_%C5%82ukasiewicz/
You may now suggest complex jokes about unstable aircraft with Poles in the starboard side of the plane.
As a native polish speaker, I agree with this comment: forvo’s pronunciation is indeed accurate, the youtube link is a disaster. Thanks teds10percent for pointing this out.
The female and male speaker pronunciations sound a bit different to me (US English speaker). Which do you think is more accurate?
FWIW, the female speaker is pretty close to the way I was taught to pronounce it somewhere, sometime by some professor.
Although I have a glow in my heart for RPN and have owned a couple of HPs with that bent, it’s really a case of modifying the human to do it the way the machine wants it done. Now, that may well be because arithmeticians and algebraists chose to arbitrarily use infix notation when they could just as well have chosen prefix or postfix. Later mathematicians almost exclusively chose prefix notation for expressing functions, whose nomenclature and notation carried over into computer languages.
Still, being used to RPN made things simple and obvious to me the first time (and second time and third time) I wrote an expression parser and other compiler-like things.
I think it is the human avoiding the unnatural way language interferes with doing arithmetic. You can’t do 2 + until you get the next argument, meaning you stack the + and until you get whatever comes next. In RPN you skip the parsing and do it the way compilers arrange it for computers. You get the arguments, then the operation, just like you always have, but without the parsing.
Some of us old-time Unix hackers (I used Version 6) may still use the dc command on our Linux boxes. It’s an infinite-precision “desk calculator” that takes RPN.
$ dc
34 25*8+p
858
q
$
Like!
dc and bc. Great examples of UNIX™ tools the way Brian, Ken, and Dennis envisioned.
Fixed point and not using notation common people are used to making users run back to windows to open up calc.exe? :-)
I’ll have to keep this information in my back pocket, I’m sure I’ll be using it.
dc is the f*king bomb, but you must remember that it is fixed-point, not float. Pretty easy to drop a few digits and get blatantly wrong answers if you don’t whack an “8 k” or whatever up the front before dividing. Also great for super fast radix conversions (dec/hex/etc).
Also: HP48GX. From my cold, dead hands. There are passable emulators for it on iOS and Android too.
I am always amused to see these posts about RPN – it sometimes looks like an insult. RPN is Maths Science. It is just a way to get a production run going on a conveyer belt. And one implementation is Forth. See the Forth Bookshelf at https://www.amazon.co.uk/Juergen-Pintaske/e/B00N8HVEZM
It’s interesting because I encountered RPN first as an Engineer and then second when I worked in finance. The HP-12C, which utilzes RPN, is still one of the favorite calculators used investment bankers and other investment professionals use when they don’t have the luxury of having a computer in front of them. You can do a lot of rather complex calculations on the fly, and I still use mine…
An HP15C was my first. After screwing up a test because of the shit buttons on a TI, I forswore them forever.
My favorite RPN calculator now is calc.el in emacs. If you are in the intersection of RPN people and emacs people, it is an amazing tool. There is all sorts of stuff in there, unit conversions, binary logic, matrix math, equation simplification and much more.
+1 for the 15C. It was a lifesaver when I was in school. (especially with the ability to do complex numbers!) I still have mine, and I feel a bit sad that now I only use it for simple calculations.
got my HP45 in 1974 – really like it – but it was stolen with some other things – so sad – I still have an 11C on my desk – – was a bad day also when my 12C Financial had problems
Really like the ability to write programs for them – used one for food processing and the math to calculate when to end a cook process and calculate the actual process time in minutes – eliminated math errors – great calculators
The HP 16C Programmer’s Calculator was a fantastic tool. They still sell for quite a bit on eBay, and Swiss Micros even offers a new version. https://www.swissmicros.com/
My first HP was an HP-67, card reader and all that. I still have it, but the card reader stopped working long ago. I also have an HP-16C that I use practically everyday as a very active software developer.
You make RPN sound like spinach (as in “eat your spinach — it’s weird and doesnt taste good but it’s good for you”).
The reason RPN is valuable, and the reason RPN calculators are still the standard for accountants and people with MBAs is that *you use them the same way you’d do the calculation by hand*.
If you do 5+7*9 by hand you’ll add the five and seven, then multiply that by 9 (or if you’re a weirdo, multiply 7 by 9 and add five to it). The point is you do complex calculations in a “natural” way — you can even follow along with your finger.
So yes, they can “teach” you how a stack works etc, but really they are easier for all but very simple sums, or, possibly, adding up a column of numbers.
Um, these two give different answers
“add the five and seven, then multiply that by 9” = 108
“multiply 7 by 9 and add five to it” = 68
Indeed they do, but as another poster commented,, which is weird is in the eye of the beholder
>> (or if you’re a weirdo, multiply 7 by 9 and add five to it)
To you, that may be weird. To the rest of the world, that’s normal. In polite society, multiplication has higher precedence than addition.
Fortunately in our liberty-loving society of RPN users we are free to use whatever precedence rules we wish and not be hidebound by aristocratic traditions of yesteryear.
“Calculators of the world unite! You have nothing to lose but your =! “
Aside: It’s the processed / minced spinach that’s weird. Try making a salad with fresh, whole spinach leaves – totally different experience.
Whilst I was still doing my A-levels using a slide rule the Sinclair Scientific I got from my grandad was sheer science fiction. I had no clue about RPN at the time, fortunately I was walked through it, and later came across something similar in the forth of the Jupiter Ace.
Anyway, great post. Happy days.
Back in the day most engineers were using Tis, they were cheap (sort of) and there was always that one guy with an Hp on his desk. People would look both ways and sneak into the office just to get a look at one. As I recall they were several hundred $ at the time. I still have a 32s but the display is going bad ( I would replace it if I find one) and it has been great for many years. The company I worked for supplied everyone with a top secret clearance working in a vault (SKIF) with one which stayed in the vault until the job was done and the memory was scrubbed and it was yours.
I had a HP11C bought in 1981 which was $115 retail. The HP41C was in a class by itself and cost around $300 plus people often bought peripherals for it. My 11C died in the late 90’s but I was able to get a HP Anniversary Edition 15C to replace it a few years ago. Unfortunately, while it is 100x faster than the original, the new made in China build is noticeably not as well made.
Me too. I still use my HP 41C on a daily basis, even with one decimal point on the LCD now non-functional. I didn’t have the Sinclair Scientific but did have a Sinclair Cambridge Programmable which was a very funny, somewhat buggy, programmable calculator. I guess it also used some ancient National Semiconductor microprocessor.
Just a smooth shout out for the folks at
The Museum of HP Calculators (MoHPC)
http://www.hpmuseum.org/
I don’t consider is any more confusing than learning anything else. Touching your first (computer) keyboard was confusing at first. Writing my first (commodore basic) program was confusing at first. Its not really confusion, simply a learning curve.
For those in the UK. Most reel based machines made by Barcrest were programmed in FORTH up to about 2000.
I managed to snag one of the limited edition 15C’s from a few years back. I used it every day in school and keep an RPN app on my phone for when I am out and about. It just flows so much better.
The real killer app for RPN is fractions where there are additions or subtractions in numerator or denominator. 12 8 – 4 /. No parentheses? No precedence? No problem. The numerator is evaluated as soon as you type in the “-“.
RPN / postfix is actually very intuitive. Get the things you want to operate on, then operate.
Much more so than normal math notation, where there are these arbitrary precedence rules (where did they come from?) and then parentheses all around b/c half of the time you need to violate the rules.
If I had a dollar for every time I have to think hard about whether modulo has a higher precedence than bit-shift…. or just wrap everything in “safety” parentheses. It’s like a cry for help that nobody’s listening to.
The more sophisticated calculators allowed more than numbers on their stacks.
PostScript. Object pointers on the stack.
RPN is one of those great tricks every Computer Science person should know. I recently became obsessed with the “10958 problem” (https://www.youtube.com/watch?v=-ruC5A9EzzE) and was able to write a pretty eloquent solver for it, taking advantage of RPN.
Adding to the crowd, once you get familiar with it RPN is much easier to use than algebraic notation for many problems. How easy is it to forget a parenthesis key entering an algebraic formula? Or to get too many because of keyboard bounce? With RPN you see what you get, and if you accidentally do an extra step it’s obvious, and you can back up the stack to reverse the error.
Some years ago, I bought a new in box 41C at a thrift store for $4.50. Still had all the original papers, batteries had never been installed. All but one of the original Energizer N cells still had full voltage. It had an Oregon State University Bookstore $250.00 price sticker on the box.
I sold it on eBay, IIRC for $450.00
Why did I bother buying an old calculator? A friend had a 41C and his dad used a 41CV in his work for the Oregon Department Of Transportation, with a surveying calculation program cartridge. I wasn’t interested in *using* it myself. If it hadn’t been in never used condition I probably would’ve offered it cheap to my friend.
Another old tech item to be on the lookout for are the Casio touch screen calculator watches in working condition. They came in two types. One had a number pad displayed on the LCD, the other had no keypad, you’d draw the numbers, operators and = on the face. The digitizers are fairly delicate, a scratch can destroy them. I found a working one for 50 cents at a thrift store. Had no idea what it’d bring, put it on eBay and it went for $50. :)
Yes, the other bonus to accumulating RPN calculators over the years is they are all collector’s items now.
I used to be confused by RPN, but then it came to me in a rather horrible dream I’d rather not describe.. I woke in an almost giddy or manic state, and wrote an interpreter for it. Since then, I’ve gone on to understand FORTH, tokenisers, parsers, &c. An odd start, but a wonderful journey. I still like to write old-school FORTH interpreters when I’m bored. :)
Ahhh, so all you need now is a touch of Lisp!
Programmed a couple LISP interpreters. McCarthy’s paper is quite inspiring in that way! :)
Lisp uses polish (not reverse polish) notation.
But then later HP calculators combines RPN with LISP to make RPL
There’s some wonderful information on RPN & other programmable calculators of old on
https://www.rskey.org/CMS/
You can waste a couple hours there. So bring a sandwich.
My first scientific calculator was a Corvus 500 that I bought new in the mid 70″s.
http://www.thimet.de/CalcCollection/Calculators/Corvus-500/Contents.htm
I couldn’t afford an HP. It uses RPN, and I still have it. It’s in mint condition in a small shadowbox on the wall next to my computer. RPN seemed very natural to me.
I have the standard version (i.e. “normal” calculator) from 1975 and it is a beautiful piece of design. Mine is in black and still looks futuristic. As Jenny noted, the case is very smart – an early example of a single-piece clamshell with a live hinge.
I have my old 41 C, plus card reader and original boxes and manuals for both. Wonder what they would get on eBay? I use pcalc on my phone these days, so could happily part with it to a good home.
Most (if not all) scientific calculators combine infix and RPN, e.g.how to get the sin of 45 degrees? [4] [5] [Sin]
Nobody notices!
Almost … in the case you gave 45 is not an operand, it’s an index.
Mrd. List, you triggered me.
In just 4 Weeks Sat.2017-11-18 and Sun.-19 the VCFe.ch will be held at the RoteFabrik in Zürich-Wiedikon (Switzerland).
I’ll be there exhibiting around 30 items around pocket calculators: from abacus, log-tables, slide rules’n’disc, mech.addition machines, electronic pocket calculators (mostly HPs, mostly working, mostly RPN) of all generations (printing, bubble LEDs, LCD, graphing) incl. swissmicros.ch.
I can cover the time span from far past to even the future (can’t spoil everything about this :-)
Beside RPN, I’m also fluent in de, it, fr, en and can get along in es too.
It is foreseen that I give an introductory talk on logarithms (de).
Stop by my stand and identify yourself with a any non-HP-RPN-pocket calculator as I’ve never seen one in reality :-)
Need to correct my autotypos:
*Ms. List
*RoteFabrik in Zürich-Wollishofen, few minutes drive/pub.transp. from Zürich-City, along the west shore of the lake
Here’s a nice RPN calculator for iPhone, if you like that sort of thing. *cough*shamelessplug*cough*
http://www.itunes.com/apps/codercalc
No spyware, right?
(that’s kind of an ironic question, coming from one of your Internet stalkers)
B^)
And then there’s FORTH . . .
I still have an HP-45 on my desk (dead battery pack but still works fine on the charger). It’s quicker to use than the calculator app on my phone (also set up for RPN). I have another HP-45 hidden away as a backup. My first RPN calculator was an HP-35 that I bought in 1973, my freshman year in college for ~$300. At that price in 1973, it never left my side. It was stolen from my office in the mid 80’s. The battery pack was shot and they didn’t take the power supply. I am not sure they would have been able to figure it out anyway!
I’ve got one of those desktop behemoths pictured – an HP9100B rescued from a museum….a CRT ang magnetic core memory….count the number of bits from the number of toroids you can see :-p
I’m so jealous! I’ve been looking for ages, but where I live, There just isn’t anything remotely like that type of hardware around where I live…
When I first got it home it wouldn’t start up. Went back and one of the circuit boards had been taken out and put in a second display cabinet on its own along with all the manuals. Slotted it in, and it came to live. Only problem is the rubber on the roller of the thermal printer has turned to goo. The museum was part of a school computer lab – I think the’d had it since it was cutting edge technology :-p
It’s mind blowing that they used a CRT and made a character graphics generator with discreet transistors.
Good stuff from a Cs get degrees U of U BSME who broke his 48Gx display setting down his bag for his final final exam. The proctor gave me a Ti.
How about a follow up piece on pocket protectors as they too are misunderstood by most but loved by those in the know. A well filled pocket protector holds more than just leaky ball points.
Coming from a CS background: if you want to get the RPN version of an expression draw out the expression tree and then traverse it pre-order/depth-first so that your leaf node operands are written before the interior-node operators.
+1. Elaborating on Steven Clark’s remark, most of what we do on calculators involves evaluating mathematical expressions. An example of an expression is “2*(3+4)”. Expressions typically consist of binary operators such as “*” and “+” and operands such as “2”, “3”, and “4”. An expression can be represented as a binary tree with an operator at its root and with each operator having literal operands and/or subexpressions as its children. The tree represents the mathematical concept that is being computed and is independent of RPN vs “regular”. There’s no cheap & easy way to load such trees into calculators, though, so we serialize the tree using a traversal algorithm and input the serialized form into the calculator. Common traversal algorithms include pre-order traversal, in-order traversal, and post-order traversal; they all list the operators and operands, just in varying orders. An infix traversal yields a “regular” (“infix”) calculator input, as used with a TI-89. A post-order traversal yields a RPN (“postfix”) calculator input. A pre-order traversal yields a PN (“prefix”) calculator input.
For more info, check out Wikipedia or pick up a textbook on discrete math
https://en.m.wikipedia.org/wiki/Binary_expression_tree
https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=discrete+math+epp&rh=n%3A283155%2Ck%3Adiscrete+math+epp
This sort of stuff is very much considered math, though most folks outside of the math / computer science / computer engineering disciplines are never introduced to it in school (which I think is a shame because I find this stuff to be fun despite finding mainstream “math” – ie arithmetic – to be tedious).
I was introduced to RPN by a friend in college. I’m now cursed by not being able to use any calculator other than HP. Whenever I don’t have my HP anyone who watches me try to use an algebraic notation calculator thinks I am a fool with tourette’s syndrome. My smug revenge is lending my HP out whenever an unsuspecting victim asks to borrow a calculator, just to see how long it takes them to tell me it is broken.
I bought a Sinclair Scientific as a Physics student in 1975. It cost £25 iirc. When it arrived I thought it was a scale model as I’d never seen one in the ‘flesh’ and hadn’t realised they were so small. One other student in my class had a calculator, an HP-whatever which was much bigger and chunkier. He blew his whole term’s student grant of about £125 but you could see the difference in quality.
The Sinclair had rather clicky buttons and the display was tiny with a purple window. It only did scientific notation I think and made a real racket for several seconds on any nearby broadcast radio receiver while it worked on a calculation!
Sadly I don’t still have it as I sold it to a friend after a couple of years for £2. (Dummy!)
I grew up using a HP35, used an HP25 through out engineering school, and my HP10c still functions.
I was taught to to solve problems from the inside out, so I find the non-RPN calculators a bit confusing.
I’m happy that calculators are just apps, and will continue using my hp21 calculator app on my phone.
I don’t have time to read all the other comments, so it may have been mentioned, but Surveyors and Engineers still use the HP 48s and even the 41s to this day. Both my bosses and several of my other clients use them often. We have multiple 48GXs and several 41CXs around the office, and they all get used regularly. Around here (Civil Engineering office), RPN is about all we use.
Very interesting article, thanks!
Found a Commodore calculator at a flea market and got it for $1. It was a sweet find.