On Fri, 2009-11-27 at 17:06 +0100, S. Chris Colbert wrote: > This seems strange to me, but perhaps I am just missing something: <snip> > I would think that second loop should terminate at 9.9, no? > > I am missing something fundamental?
Floating points variables ... http://en.wikipedia.org/wiki/Floating_point 0.1 isn't represented internally, so you haven't actually reached 10. - try comparing that "10." (as it's printed) with 10.0 i.e. print (t == 10.) you'll get False - even though they print the same Tim -- http://mail.python.org/mailman/listinfo/python-list