1/2
gives
0
as it should. However,
-1/2
-1
why reinvent the wheel, when there's a perfectly good math.trunc() function?
import math print(math.trunc(-3.5)) >>-3 print(math.trunc(3.5)) >>3