Post Reply 
RPL second impressions (HP 28)
07-01-2018, 03:49 AM (This post was last modified: 07-01-2018 08:24 PM by Thomas Klemm.)
Post: #35
RE: RPL second impressions (HP 28)
(06-30-2018 03:32 PM)Gerson W. Barbosa Wrote:  All previous ones don’t work either when n<4.

There's a problem with the FOR-loop in that it gets executed at least once even when the upper limit is smaller than the start value.

Try this line:
Quote:3 1 FOR i i END

This leaves the value 3 on the stack.
I'd prefer if the stack was left unchanged instead.

Now you can either handle that special case beforehand or then just call it a day.
How often will you use that program to check that 3 is a prime?

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RPL second impressions (HP 28) - mdunn - 06-27-2018, 01:19 AM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 01:58 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 04:06 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 05:11 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 07:45 PM
RE: RPL second impressions (HP 28) - mdunn - 06-28-2018, 08:48 PM
RE: RPL second impressions (HP 28) - Thomas Klemm - 07-01-2018 03:49 AM
RE: RPL second impressions (HP 28) - ttw - 07-04-2018, 10:52 PM



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