
Aug. 12, 2004
3 a.m.
For instance:
>>> accumulator = 0.0 >>> for i in range(25000): ... accumulator += 1.0 ... >>> print accumulator 25000.0
Notice, perfect accuracy. Yet people don't tend to use floating point for loops... why not?
Because the generalization to using fractions doesn't work. Try the same with adding 0.1, 25000 times. Better not be tempted. --Guido van Rossum (home page: http://www.python.org/~guido/)