Non-trivial operations in RPN mode
05-04-2015, 08:09 PM (This post was last modified: 05-04-2015 08:11 PM by Marcio.)
Post: #1
 Marcio Senior Member Posts: 438 Joined: Feb 2015
Non-trivial operations in RPN mode
Hello,

I read the manual but it does not mention it'd be possible for commands to take more than 1 argument from the stack. Does anybody know how to do that? Or is RPN still limited to basic operations like cos(a), sin(b) etc?

Thanks

Marcio
05-04-2015, 08:13 PM
Post: #2
 Jonathan Cameron Member Posts: 205 Joined: Dec 2013
RE: Non-trivial operations in RPN mode
(05-04-2015 08:09 PM)Marcio Wrote:  I read the manual but it does not mention it'd be possible for commands to take more than 1 argument from the stack. Does anybody know how to do that? Or is RPN limited to basic operations like cos(a), sin(b) etc?

Include the number of arguments as an argument to the command in RPN mode:

1 [ENTER]
2 [ENTER]
cmd(2)

executes the 'cmd' command instructing it to take 2 numbers from the stack.

-Jonathan
05-04-2015, 08:15 PM
Post: #3
 Jonathan Cameron Member Posts: 205 Joined: Dec 2013
RE: Non-trivial operations in RPN mode
(05-04-2015 08:13 PM)Jonathan Cameron Wrote:  Include the number of arguments as an argument to the command in RPN mode:

1 [ENTER]
2 [ENTER]
cmd(2)

executes the 'cmd' command instructing it to take 2 numbers from the stack.

What I would like to know is how to create programmed functions that take a pre-determined number of parameters that you define in the function definition, so you do not need to tell the function how many arguments are needed.

-Jonathan
05-04-2015, 08:23 PM (This post was last modified: 05-04-2015 09:24 PM by Marcio.)
Post: #4
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Non-trivial operations in RPN mode
(05-04-2015 08:13 PM)Jonathan Cameron Wrote:
(05-04-2015 08:09 PM)Marcio Wrote:  I read the manual but it does not mention it'd be possible for commands to take more than 1 argument from the stack. Does anybody know how to do that? Or is RPN limited to basic operations like cos(a), sin(b) etc?

Include the number of arguments as an argument to the command in RPN mode:

1 [ENTER]
2 [ENTER]
cmd(2)

executes the 'cmd' command instructing it to take 2 numbers from the stack.

-Jonathan

Brilliant! Thanks Jonathan. This way I can kinda 'emulate' the 50g inside the Prime, and at a small price of writing specific programs for the commands I use the most. Luckily, I can group them into a single program.

Very much appreciated. Made my day!

Marcio
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)