Post Reply 
(HP17BII) What way for a loop stop condition ?
05-09-2020, 05:43 PM
Post: #4
RE: (HP17BII) What way for a loop stop condition ?
(05-09-2020 02:27 PM)Don Shepherd Wrote:  You can always terminate a solver sigma loop early on the 17bii and 17b by performing an illegal operation (like LOG(0) or /0), but that will also end the evaluation of the equation. In many cases you can save the value you want in a variable and then RCL that variable after the error message. I have used this method successfully many times, such as in my prime factor finder:

Code:

primef:if(mod(n:2)=0:L(fact:2)+L(n:n/2)/0:sigma(i:3:sqrt(n):2:if(mod(n:i)=0:L(fact:i)+L(n:n/i)/0:0))+n)-fact

Hope this helps.

(05-09-2020 02:36 PM)mfleming Wrote:  If you're not already familiar with the Solver GET-LET document by Martin Hepperle, I would highly recommend it, along with the Technical Applications book used as a reference

https://www.hpmuseum.org/forum/thread-6573.html

Thank you very much Don Shepherd and mfleming!
So I'm going to insert a tiny presence of abrupt end in my equation!
I will reread with pleasure the precious document published by Martin Hepperle, augmented by Don Shepherd, thanks to which I had already progressed a few years ago!

That's nice !
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (HP17BII) What way for a loop stop condition ? - Nihotte(lma) - 05-09-2020 05:43 PM



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