Python's int(x) Rounds Towards Zero

I was surprised to learn that Python's int function rounds floats towards zero.
Here's the relevant excerpt from the official docs:

[…] For floating point numbers, this truncates towards zero.

Example
from math import floor, ceil

assert(int(-0.8) == 0)
assert(floor(-0.8) == -1)
assert(ceil(-0.8) == 0)

If you want the floored result, you need to use math.floor. If you want the ceilling result, you need to use math.ceil.