wtf

Shane Hathaway shane at hathawaymix.org
Thu Apr 26 14:38:59 EDT 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