Post Reply 
(50g) Bernoulli polynomials
12-17-2018, 06:07 PM (This post was last modified: 12-17-2018 06:29 PM by DavidM.)
Post: #2
RE: (50g) Bernoulli polynomials
(12-17-2018 05:31 PM)peacecalc Wrote:  Enjoy it and tell me your improvements and critics.

Hi peacecalc!

I won't pretend to know anything about the math side of what this does (or is appropriate for), but reading through your description sparked a thought about a possible alternative means to deal with a varying number of stack arguments.

In my RPL programs, I've always tried to avoid situations where the stack can't have results from previous operations on it, since I feel like anything on the stack above the needed arguments for a given program is purely up to the user -- why limit the user's ability to have the results from other calculations present? One of the best things about RPN operations (IMHO) is the ability to retain the results of intermediate calculations while you are experimenting. Forcing the user to have to clear the stack before executing a program can be very disruptive.

One very easy way to accommodate the possibility of a varying number of arguments is to place them in a list { } before invoking the program. Placing a list of items on the stack is actually very easy (only one shifted key more than individually loading them). Your program then simply needs to execute LIST→ instead of DEPTH to determine how many arguments were given.

I believe this is a small adjustment to make in comparison to the benefits to the user of not having to clear the stack first.

Just a thought!

Edit:

One other possibility... since you are looking for either 1 or 2 arguments, simply mandate that the user place both of them on the stack, using ENTER to create a second copy if only one is actually needed. The program could then check to see if the two stack arguments are equal before deciding which course of action to take. That's just one more keystroke (ENTER) in the case of only one argument.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50g) Bernoulli polynomials - peacecalc - 12-17-2018, 05:31 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-17-2018 06:07 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-17-2018, 08:37 PM
RE: (50g) Bernoulli polynomials - ttw - 12-17-2018, 09:17 PM
RE: (50g) Bernoulli polynomials - ijabbott - 12-17-2018, 11:58 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-29-2018, 04:40 PM
RE: (50g) Bernoulli polynomials - ttw - 01-02-2019, 11:13 PM



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