HP Forums

Full Version: How to add a 'constant' using RPN?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


how do you add a constant over and over again? I have an HP12c and I would like to take a starting value and keep adding 128 to it.

I can do this by taking the original value 1240 + 128. One would do it like this:

1240 ENTER
128 +

This gives me a total to which I want to add 128 to. What is the easiest way to do that? I can hit ENTER and 128 + once again, but is there a better way?

On certain 'regular' calculators, one has to just hit the plus button and you get your answer. Is there something similar using RPN?


It's easy!

Simply type in "128", Enter, Enter, Enter.

Then type in an X value, hit "+".

You can keep adding 128 to the total by hitting "+".

Or, to add another number to 128, hit "CLX"; type in the new X, then hit plus.

Any value placed in the "t" register will be duplicated when the stack "drops".



128 (# in your example), enter, enter, enter, whatever # you want to preform arithmatic on, + - X or /, note or store your answer, roll down, key in the next number you want to preform an operation on, then + - X or /, note or store the answer, roll down, repete till your tired of it. this works on any rpn with a replicating t register, not just hp.

Just a word of caution;

This doesn't work on all HPs, only those with 4-level stacks.

Filling the t-stack with your constant won't work on the 28 and 48, for instance, because neither calculator has a t-level

Interestingly, it does work on the 17BII and 19BII, eventhough they don't actually have a standard 4-level stack...their stack expands to a maximum of 4 levels, depending on the number of items placed in it.


I am not familiar with the 12c, but if it is capable of it. Do a 128 STO 01, then every time you wanted to +, -, *, or / you could do a RCL+ 01, RCL- 01, RCL* 01 or RCL/ 01. This has the advantage of leaving the stack elements in place for other calculations.

Thank you all for the timely answers. I appreciate it.


I'd probably use the LASTX command. Press the prefix key g, then LSTX (the ENTER key), and then +.