python 取比当前值小的最小值
1.取比当前值小的最小值
import math
from math import floor
a = 1.58
b = -34.77
print floor(a) #a 输出为1
print floor(b) #b 输出为-35
2. 四舍五入
print round(1.58) # 输出为2
print round(-34.77) # 输出为35
1.取比当前值小的最小值
import math
from math import floor
a = 1.58
b = -34.77
print floor(a) #a 输出为1
print floor(b) #b 输出为-35
2. 四舍五入
print round(1.58) # 输出为2
print round(-34.77) # 输出为35