math库中实用的函数 >>> import math >>> math.ceil(3.14) 3 >>> math.floor(3.14) 4 >>> math.degrees(pi/4) 45.0 >>> math.fabs(-3) 3 >>> math.factorial(3) 6 >>> math.log(x,a) #a默认是e,但是也可以指定 >>> math.log(16,2) 5 >>> math.pow(3,4) 81 >>> math.sqrt(81) 9.0