2.6.1 - simple division

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Mar 8 10:33:01 EDT 2009


En Sun, 08 Mar 2009 12:22:50 -0200, <farsight at gmail.com> escribió:

> On Mar 8, 2:16 pm, farsi... at gmail.com wrote:
>> >>> 4 / 5.0
>>
>> 0.800000000000000004
>> >>> 0.8 * 5
>>
>> 4.0
>>
>> python 2.6.1 on mac. What the hell is going on here?
>
> Pure curiosity prompted me to try the following:
>>>> 40 / 5.0
> 8.0
>
> Strange...

See http://docs.python.org/tutorial/floatingpoint.html


-- 
Gabriel Genellina




More information about the Python-list mailing list