HP Forums

Full Version: How to use RPN mode with Functions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello - I bought a Prime ages ago but only recently tried to use it. My 15C had been quite sufficient thus far.

Anyway I entered a function definition and then tried to resolve it at the Home screen using Textbook entry, and it was fine.

But when I switch to RPN mode I get a syntax error.

E.g., if I define F1 = X^2 (for example)

Textbook mode, I press Vars and then find the symbolic F1 entry, it shows F1 on the Home screen. Then I press the () key and then enter, say, 5. Then ENTER, and it would resolve to F(5) which is 25.

But RPN mode doesn't work. Gets error.
In RPN entry, you need to place the argument(s) onto the stack. Then you would execute a command using COMMAND(n) where n is the number of arguments used by COMMAND. In this case, your command is F1. In algebraic notation, you would enter F1(5) to get 25. In RPN notation, you would place 5 onto the stack, and type F1(1).
(03-03-2017 12:16 AM)Han Wrote: [ -> ]In RPN entry, you need to place the argument(s) onto the stack. Then you would execute a command using COMMAND(n) where n is the number of arguments used by COMMAND. In this case, your command is F1. In algebraic notation, you would enter F1(5) to get 25. In RPN notation, you would place 5 onto the stack, and type F1(1).

Ok thanks.

So if I define a function with X and Y, then I would enter Y and then X onto the stack, and then type F1(2) to tell it to use the last 2 entered parameters on the stack?
(03-03-2017 12:37 AM)lemontea Wrote: [ -> ]
(03-03-2017 12:16 AM)Han Wrote: [ -> ]In RPN entry, you need to place the argument(s) onto the stack. Then you would execute a command using COMMAND(n) where n is the number of arguments used by COMMAND. In this case, your command is F1. In algebraic notation, you would enter F1(5) to get 25. In RPN notation, you would place 5 onto the stack, and type F1(1).

Ok thanks.

So if I define a function with X and Y, then I would enter Y and then X onto the stack, and then type F1(2) to tell it to use the last 2 entered parameters on the stack?

Yes, for a general 2-variable function. Usually, F1 is intended for a single-variable function.
(03-03-2017 12:52 AM)Han Wrote: [ -> ]
(03-03-2017 12:37 AM)lemontea Wrote: [ -> ]Ok thanks.

So if I define a function with X and Y, then I would enter Y and then X onto the stack, and then type F1(2) to tell it to use the last 2 entered parameters on the stack?

Yes, for a general 2-variable function. Usually, F1 is intended for a single-variable function.

Thanks.

But I am thinking maybe I should just use Textbook mode... sad to see RPN go....
Note that specifying argument count only needs to be done when you have a variable number of arguments.
(03-03-2017 02:20 AM)Tim Wessman Wrote: [ -> ]Note that specifying argument count only needs to be done when you have a variable number of arguments.

I tried not specifying anything and it didn't work.
(03-03-2017 02:53 AM)lemontea Wrote: [ -> ]I tried not specifying anything and it didn't work.

F1 can take a variable number of arguments.

Use the define key, define a named function, and it wouldn't require it. Nor would something like CEIL, SIN, or similar.
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :