|Re: Determining significand length of the HP 33s|
Message #5 Posted by Les Wright on 17 May 2007, 11:08 p.m.,
in response to message #1 by G. Cone
I must admit that in pretty all of my RPN program that require convergence to equality of some sort, whether it is to zero or to something else, I simply go until actual equality and don't use epsilon in the same way one does in C, Visual Basic, or Pascal code.
My understanding is that even though the RPN calculators I use carry internal guard digits, these extra digits are lost when a value is returned to the stack. Therefore, in virtually all cases where I need a desired value to stop changing in the 12 (or 10) displayed digits before exiting a loop, simply testing for non-equality is the way I do it. If "old" and "new" values of the desired parameter are not equal, I loop back to the beginning of the loop, otherwise I skip the GTO after the conditional test and carry on.
This almost always works in cases where I am computing a convergent series or continued fraction representation of a desired function. In root solving, though, there may be some "wiggle" in the last digit which I can see if I display interim approximations. In those cases the loop ends when I do specify some desired epsilon, such as 1e-8.