1/2
gives
0
as it should. However,
-1/2
-1
Try this. Only works for numbers greater than -1
import math x = .5 y = -.5 print math.floor(math.fabs(x)) >> 0 print math.floor(math.fabs(y)) >> 0