[PythonCE] __future__, division
Isr Gish
isrgish at fastem.com
Mon Jul 19 05:11:39 CEST 2004
>From: "David L. Kashtan"<kashtan at Validus.Com>
>Sent: 7/18/04 9:31:55 PM
>To: "Isr Gish"<isrgish at fastem.com>
>Subject: RE: [PythonCE] __future__, division
>
>Why do you think that float division doesn't work? You don't have
>to import anything from __future__:
>
>>>> a=2.1/1.23
>>>> a
>1.7073170731707319
>
>What am I missing?
Hi David,
Since 2.2 if you import division from __future__, then you can do this:
>>> from __future__ import division
>>> 5/3
1.6666666666666667
As if you whould have done float division
And
>>> 5//3
1
All the best,
Isr
>David
>
More information about the PythonCE
mailing list