都在math模块里面呀 import math #以下返回值都是浮点型 math.log(x,base)#默认base=e自然对数 math.ceil(x)#向上取整 math.floor(x)#向下取整 math.round(x)#四舍五入 #math.log(x) 就相当于数学中的ln(x),x>0,求底数为e的对数,e = 2.718281828459; #math.log10(x) 就相当于数学中的lg(x),x>0,求底数为10的对数;