python 3.44 float addition bug?

Gary Herron gary.herron at islandtraining.com
Fri Jun 20 21:19:28 EDT 2014


On 06/20/2014 06:11 PM, FraserL wrote:
> Ok I've seen https://docs.python.org/2/tutorial/floatingpoint.html now
> thanks to Yhg1s on #python
>
> I bet you get this kind of thing a lot, sorry :-/

Yes, often, but it's not a problem. :-)


>
>
> FraserL <fraser.long+usenet at NOSPAMgmail.com> wrote in
> news:XnsA35313E634BA0fraserlonggmailcom34 at 216.196.109.145:
>
>> I think I found a strange bug in python 3.4.1,
> ...
>> #test code
>> z = 0.01
>> p = 0.0
>> for x, y in enumerate(range(1, 20)):
>>      p += z
>>      print(p)
>> #end
>>
>>
>> 3.4.1 output:
>>
> ...
>> 0.05
>> 0.060000000000000005
>> 0.07
> ...
>>
>> I'm not hugely accustomed to Python, but this seems crazy to me.
>>




More information about the Python-list mailing list