', 'log10', 'log1p', 'log2', 'modf', 'nan', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh...', 'log10', 'phase', 'pi', 'polar', 'rect', 'sin', 'sinh', 'sqrt', 'tan', 'tanh']
可以看到math模块和cmath模块都有大量的方法...(x) # 如math.log(math.e)返回1.0,math.log(100,10)返回2.0
math.log10(x) # 返回以10为基数的x的对数,如math.log10...math.sqrt(x) # 返回数字x的平方根
可以看到,上面有些方法是直接写出的,如 abs(x) ,而有一些方法前面有 math....math.hypot(x, y) # 返回欧几里德范数 math.sqrt(x*x + y*y)。
math.sin(x) # 返回的x弧度的正弦值。