At 12:45 AM 11/20/2007, Dennis Lee Bieber wrote: >On Mon, 19 Nov 2007 23:41:02 -0800, Dick Moores <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > > > a way to get it to break where I want it to, i.e., when the sum > > equals the limit as closely as the precision allows? > > > > > if sum >= limit: > > Well, since it ISN'T a case of testing for an absolute equivalence >with floats... > > Perhaps putting a "print sum, limit" before that point would reveal >what type of values you are encountering.
If you run the program you'll see exactly that, if I understand you correctly. <http://python.pastebin.com/f2f06fd76> shows the full output for a precision of 50 and x == 5. Dick -- http://mail.python.org/mailman/listinfo/python-list