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 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)