[Python-Dev] Re: Re: Decimal type question [Prothon] (original) (raw)
Guido van Rossum guido at python.org
Thu Aug 12 05:00:30 CEST 2004
- Previous message: [Python-Dev] Re: Re: Decimal type question [Prothon]
- Next message: [Python-Dev] Re: Re: Decimal type question [Prothon]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/)
- Previous message: [Python-Dev] Re: Re: Decimal type question [Prothon]
- Next message: [Python-Dev] Re: Re: Decimal type question [Prothon]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]