How to add a 'constant' using RPN?



#6

Question:

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?

Thanks,
joe


#7

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".

Easy!

Michael

#8

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.


#9

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.

B.

#10

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.

#11

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

joe

#12

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


Possibly Related Threads...
Thread Author Replies Views Last Post
  How to add image to HP Forum Posting Harold A Climer 2 860 11-20-2013, 02:28 PM
Last Post: Han
  [PRIME] RPN: another attempt at returning more than one value to the RPN stack Marcus von Cube, Germany 5 1,410 11-05-2013, 02:44 AM
Last Post: Marcus von Cube, Germany
  Euler's Constant Approximation Namir 0 546 10-19-2013, 11:32 AM
Last Post: Namir
  New community-maintained version of "Calculators benchmark: add loop" Pier Aiello 20 3,777 09-12-2013, 02:42 AM
Last Post: Pier Aiello
  WP-34S: # constant in exponent Marcel Samek 3 713 07-06-2013, 08:33 PM
Last Post: Paul Dale
  A cheaper way to add to your collection Keith Midson 3 1,285 03-08-2013, 05:50 AM
Last Post: Keith Midson
  Calculator Speed Benchmark (Add Loop) Thomas Chrapkiewicz 2 835 01-20-2013, 11:24 AM
Last Post: Thomas Chrapkiewicz
  Brun's constant (WP 34S) Gerson W. Barbosa 3 879 12-24-2012, 06:44 PM
Last Post: Paul Dale
  HP41 MLDL2000 add-on wins Distinctive Excellence award Meindert Kuipers 4 991 05-28-2011, 07:56 AM
Last Post: exschr
  How does one add a third-party program to Droid48? Michael Frick (California) 3 798 10-14-2010, 07:32 PM
Last Post: Allen

Forum Jump: