No matter positive or negative , All decimals are rounded in the direction of the larger number
import math
math.ceil(-0.5) # 0
math.ceil(-0.9) # 0
math.ceil(0) # 0
math.ceil(0.5) # 1
math.ceil(1.2) # 2
No matter positive or negative , All decimals are rounded to a smaller number
import math
math.floor(-0.5) # -1
math.floor(-0.9) # -1
math.floor(0) # 0
math.floor(0.5) # 0
math.floor(1.2) # 1
int() integer , It can be understood as rounding off , That is, no matter how many numbers are after the decimal , Remove all , Keep only integers
int(-1.234) # -1
int(-1.9) # -1
int(-0.5) # 0
int(0) # 0
int(0.5) # 0
int(1.9) # 1
int(1.234) # 1
int(123.456) # 123