Python from Wise Guy's Viewpoint

Alexander Schmolck a.schmolck at gmx.net
Tue Oct 28 10:58:39 EST 2003


Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> writes:
 
> Python and Ruby get it wrong: the result is an integer (truncated
> division), very different from the result of / on the same numbers
> represented in a different type.

It's being fixed since python >= 2.2 (sort of):

>>> from __future__ import division
>>> 1/3
0.33333333333333331
>>> 5//2
2

'as




More information about the Python-list mailing list