The Museum of HP Calculators

HP Forum Archive 11

 How to add a 'constant' using RPN?Message #1 Posted by joe on 17 Mar 2003, 9:57 p.m. 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

 Re: How to add a 'constant' using RPN?Message #2 Posted by Michael Meyer on 17 Mar 2003, 10:22 p.m.,in response to message #1 by joe 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

 Re: How to add a 'constant' using RPN?Message #3 Posted by db(martinez,california) on 17 Mar 2003, 10:24 p.m.,in response to message #1 by joe 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.

 Re: How to add a 'constant' using RPN?Message #4 Posted by Scuba Diver on 17 Mar 2003, 11:00 p.m.,in response to message #3 by db(martinez,california) 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.

 Re: How to add a 'constant' using RPN?Message #5 Posted by Richard Garner on 17 Mar 2003, 11:16 p.m.,in response to message #1 by joe 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.

 Re: How to add a 'constant' using RPN?Message #6 Posted by joe on 17 Mar 2003, 11:46 p.m.,in response to message #1 by joe Thank you all for the timely answers. I appreciate it. joe

 Re: How to add a 'constant' using RPN?Message #7 Posted by James M. Prange on 18 Mar 2003, 2:43 a.m.,in response to message #1 by joe I'd probably use the LASTX command. Press the prefix key g, then LSTX (the ENTER key), and then +.

Go back to the main exhibit hall