函数说明:
abs(x):返回数字的绝对值
eg.
>>> abs(-10)
10
pow(x,y[,[z]]):返回x的y的次幂(所得结果对z取模)
eg.
>>> pow(2,4)
16
>>> pow(2,4,5)#2的4次方除以5得到的余数
1
math.sqrt(x):返回x的平方根
eg.
>>> math.sqrt(16)
4.0
math.fabs(x):返回x的绝对值
eg.
>>> math.fabs(-10)
10.0
math.ceil(x):返回x的上入整数
eg.
>>> math.ceil(5.3)
6.0
math.floor(x):返回x的下舍整数
eg.
>>> math.floor(9.9)
9.0
math.e:表示对数中e值
eg.
>>> math.e
2.718281828459045
math.pi:返回圆周率pi的值
eg.
>>> math.pi
3.141592653589793
math.exp(x):返回e的x次幂
eg.
>>> math.exp(1)
2.718281828459045
math.log(x[,base]):以base为基数,x的对数,默认bae为e
eg.
>>> math.log(math.e)
1.0
>>> math.log(100,10)
2.0
math.log10(x):以10为基数,x的对数
eg.
>>> math.log10(100)
2.0
math.pow(x,y):返回x的y次幂
eg.
>>> math.pow(2,3)
8.0
math.degrees(x):将弧度转化为角度
eg.
>>> math.degrees(math.radians(30))
29.999999999999996
math.radians(x):将角度转化为弧度
eg.
>>> math.radians(30)
0.5235987755982988
math.sin(x):返回正弦值
eg.
>>> math.sin(math.pi/2)
1.0
math.cos(x):返回余弦值
eg.
>>> math.cos(math.pi)
-1.0
math.tan(x):返回正切值