Post Reply 
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
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
Find all posts by this user
Quote this message in a reply
05-04-2015, 08:13 PM
Post: #2
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
Visit this user's website Find all posts by this user
Quote this message in a reply
05-04-2015, 08:15 PM
Post: #3
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
Visit this user's website Find all posts by this user
Quote this message in a reply
05-04-2015, 08:23 PM (This post was last modified: 05-04-2015 09:24 PM by Marcio.)
Post: #4
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
Find all posts by this user
Quote this message in a reply
Post Reply 




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