HP Forums
Evaluate Function variable in RPN mode? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Evaluate Function variable in RPN mode? (/thread-612.html)



Evaluate Function variable in RPN mode? - David Hayden - 02-04-2014 12:58 PM

If I store a function like (X-4)/X in F1, then I can evaluate F1 at different values of X in Textbook mode very easily. For example, I just type F1(0) or F1(3) to evaluate it at X=0 or X=3.

But in RPN mode I have to enter a value into variable X, then recall F1 and EVAL it. Is there an easier way? Since F0-F9 are functions in X, it would easier if they just took their argument from the stack like the built in functions.

Thanks,
Dave


RE: Evaluate Function variable in RPN mode? - Han - 02-04-2014 01:33 PM

F1 behaves like a program. In RPN, commands are typed as: COMMAND(n) where the n designates the number of arguments for COMMAND. Suppose F1(X):=2*X^2-4. If you type 9 ENTER F1(1) then it executes F1 as a program using 1 argument, namely the 9 on the stack. Unlike the other commands where one can leave off the "(1)" in the case of a single argument, you must explicitly specify "F1(1)" (from what I can tell). Typing F1 by itself recalls the formula for F1 as I'm sure you already found out.


RE: Evaluate Function variable in RPN mode? - Tim Wessman - 02-04-2014 02:14 PM

The reason for this is that you have a function that can either take no arguments (in which case it recalls itself) or take 1 argument and evaluate through the function.


RE: Evaluate Function variable in RPN mode? - David Hayden - 02-04-2014 02:27 PM

Thank you Han and Tim! I had a vague recollection about the parens but didn't remember that you must include the argument count.

Thanks,
Dave