python除法:
x = 1
y = 2
r = x / y
此时的结果为:
0.5
python除法向下取整:
x = 1
y = 2
r = x // y
此时结果为:
0
python除法向上取整:
import math
x = 1
y = 2
print(math.ceil(x / y))
此时结果为:
1
python除法:
x = 1
y = 2
r = x / y
此时的结果为:
0.5
python除法向下取整:
x = 1
y = 2
r = x // y
此时结果为:
0
python除法向上取整:
import math
x = 1
y = 2
print(math.ceil(x / y))
此时结果为:
1