RPN Tutorial


RPN Tutorial (basic)

In light of the HP 15C LE, it is my hope that there are new users of RPN calculators, either through the HP 15C, or by an Andriod (sp?) or iPhone/iPad app. This is a short "do by example" tutorial on basic RPN that I posted on my blog. It is not towards any specific calculator in hopes that newbies can learn from it whatever RPN machines/emulators they have.

I am thinking of doing a basic keystroke programming tutorial (15C, 12C, or if anyone has a request, I'll try cater to that calculator instead - note my 41C is in repairs, I don't have a 42 (but I have Free42), and I don't have an Andriod device). Please check out the blog and me know what you think.


Edited: 25 Sept 2011, 1:56 a.m.


Hello Eddie,

Nice. You may include this graph: RPN STACK PERMUTATIONS

See this thread: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv020.cgi?read=184373



Hi Eddie,

I think it's a good idea to familiarize others with the benefits of RPN. However, some errors should be removed:

RPN uses one stack that consists of (usually) four registers X, Y, Z and T.

Your text however says:

"Typically, RPN calculators uses four stacks, named X, Y, Y, and Z."

Instead, it should read:

"Typically, RPN calculators use a stack consisting of four registers, named X, Y, Z, and T."

So, X, Y, Z and T are four registers (not stacks), each register stacked on top of the other. That's why the whole arrangement is called a stack.

Maybe an RPN novice will get the idea behind the stack more quickly if the examples show intermediate results. For instance like this (example #5):

  2  [1/x]           0,5000
3 [ENTER] 7 [÷] 0,4286
[+] 0,9286
25 [ENTER] 64 [÷] 0,3906
[sqrt] 0,6250 ; use the symbol instead - there is no key labelled "sqrt"
[-] 0,3036 ; do not omit the leading zero - it's displayed

Re. Enter: about 30 years ago I had a book on RPN that described the idea behind the ENTER key in two-argument calculations this way: ENTER is required to tell the calculator that you have completed number entry. So 5 ENTER 3 enters two numbers five and three instead of a 53, thus separating the 5 from the 3. This also means that an ENTER is not required before or after a numeric operation, before or after a STO or RCL, before or after Pi, etc.: in all these cases it's clear that the current number resp. result is complete, and everything keyed in next will belong to a new number. So the first ENTER in your example #5 is obsolete since after 1/x the calculator knows that the result (1/2) is complete and the following 3 belongs to a new number.

This idea was very helpful for me in the first weeks after I aquired my brand new 34C back then. Maybe you will find it useful as well. I really like the idea to help new RPN users the way you intended. That's why I suggest these improvements. :-)



Thanks Dieter and Xaiver not only for the suggestions but also finding the errors. Xaiver, I want to study the diagram closer so I can understand it.

RPN Tutorial Take 2


Nice work :-) For the example with the square root of the sum of squares, however, I'd prefer

instead of using y^x.


... which will not work on the 20b or 30b in RPN mode.


One more reason why I dislike RPL, also camouflaged.


However, the above method (3 ENTER X etc...) works on the WP-34S.


Since we did our best to make it RPN :-)


Eight keystrokes!!! That's way too complicated, Walter. ;-)

In cases like these I usually type

 3 ENTER 4  R-P
or even
  3 i 4  ABS
Both suggested methods also provide better precision than a manual calculation. So this rectangular-polar conversion stuff (which I don't use at all otherwise) finally makes some sense to me. ;-)



You're right absolutely, Dieter :-) Please compare, however, also with the ten keystrokes in Eddie's original tutorial, take 2. After all, your solution is the best :-)

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime Tutorial #6 and #7: Drawing Eddie W. Shore 2 659 12-10-2013, 08:16 AM
Last Post: Eddie W. Shore
  HP Prime Tutorial #4 is up (CASE/CHOOSE/INPUT) Eddie W. Shore 1 517 11-15-2013, 07:32 AM
Last Post: Davi Ribeiro de Oliveira
  HP Prime Programming Tutorial #3: WHILE, INPUT, KILL, REPEAT, GETKEY Eddie W. Shore 5 899 11-07-2013, 12:25 AM
Last Post: Han
  [PRIME] RPN: another attempt at returning more than one value to the RPN stack Marcus von Cube, Germany 5 906 11-05-2013, 02:44 AM
Last Post: Marcus von Cube, Germany
  HP Prime Programming Tutorial #1: LOCAL, RETURN Eddie W. Shore 6 1,060 10-26-2013, 08:42 PM
Last Post: Miguel Toro
  HP Prime Programming Tutorial #2: MSGBOX, IF-THEN-ELSE, PRINT, FOR Eddie W. Shore 0 469 10-26-2013, 03:51 PM
Last Post: Eddie W. Shore
  HP 39gii Programming Tutorial Part 7 Eddie W. Shore 0 353 04-05-2013, 11:10 PM
Last Post: Eddie W. Shore
  HP 39gii Programming Tutorial Part 6: Interactive Programs Eddie W. Shore 0 346 04-01-2013, 06:00 PM
Last Post: Eddie W. Shore
  HP 39gii Tutorial Part 5 Up (finally) Eddie W. Shore 1 414 03-31-2013, 02:21 AM
Last Post: Gilles Carpentier
  HP 39gii Tutorial: REPEAT and WHILE Eddie W. Shore 6 806 03-20-2013, 06:35 PM
Last Post: C.Ret

Forum Jump: