math
有关角的函数
import math
print("arccos0.5 = ", math.acos(0.5))
print("arcsin0.5 = ", math.asin(0.5))
print("arctan1 = ", math.atan(1))
print("60度转化为rad单位为:", math.radians(60))

数学运算
对数运算
lgam = math.lgamma(4)
ln6 = math.log(6)
log10 = math.log10(10)
log2 = math.log2(2)
print("lgam:", lgam)
print("ln6:", ln6)
print(log10)
print(log2)

指数运算
fr = math.frexp(2)
ld = math.ldexp(3, 3)
ex = math.exp(2)
ex2 = math.expm1(2)
print(fr, ld, ex, ex2)

其他运算
print("fmod: 5 % 2 = ", math.fmod(5, 2))
float_list = [1.23, 2.32, 5.43, 5.44]
print("fsum求和:", math.fsum(float_list))
gamma1 = math.gamma(4)
gamma2 = math.gamma(4.4)
print("伽马函数:求阶乘 3!= {},3.4!= {}".format((gamma1, gamma2))
print(math.gcd(5, 2))
print(math.hypot(3, 4))

判断
print(math.isclose(3.333, 3.334))
isfinite(x)
isinf(x)

取值
print(math.modf(5.3)) #返回整数位和小数位
print(math.fabs(-3.3)) #取绝对值
print(math.ceil(4.444)) #向上取整
print(math.floor(4.9)) #向下取整
