wtf

Shane Hathaway shane at hathawaymix.org
Thu Apr 26 20:38:59 CEST 2007


Sergiy wrote:
> print 1 / 2
> print -1 / 2
> 
> 0
> -1
> 
> correct?

Yes.  It works like the floor() function.

>>> import math
>>> math.floor(1.0 / 2)
0.0
>>> math.floor(-1.0 / 2)
-1.0

Shane




More information about the Python-list mailing list