09-13-2022, 04:01 PM
(09-13-2022, 04:18 AM)Pete Wrote:(09-13-2022, 03:58 AM)bplus Wrote: LOOP UNTIL olda = a
Because it hard to get olda to be exactly = a
Loop Until abs(a-olda) < someTinyNumber ' Might work better
Good point. Many of these iteration functions eventually repeat. It might be an interesting challenge to find a number and root combination that does not. In any case, I would imagine when I convert this to string math, I can exit it by limiting the progressively longer output of digits. That would be preferable to trying to figure out what that "tiny number" would be with so many different decimal possibilities to consider. That's another algorithm to itself. The goal, of course, is to prevent an infinite loop situation. I could always use LOOP UNTIL STEVE = funny_looking, but that would cause a premature exit situation, in most cases.
Pete
Yes, I was thinking ahead when you did start your String Math. Actually I was surprised that loops terminated on the few tests I made with your code using Double Type but the tests were neither extremely large nor small.
SomeTinyNumber was meant to be whatever precision you want so that the answer is "good enough" usu 10^-n n being number of decimals for your precision.
Jack is probably more experienced with this stuff good to have his input here!
b = b + ...