【Python】004_Python 常用模块

一、math 与 cmath 模块

  • math 模块提供了许多对浮点数的数学运算函数。
  • cmath 模块包含了一些用于复数运算的函数。
import cmath
dir(cmath)
['__doc__', '__file__', '__loader__', '__name__', '__package__', 
'__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 
'cos', 'cosh', 'e', 'exp', 'inf', 'infj', 'isclose', 'isfinite', 
'isinf', 'isnan', 'log', 'log10', 'nan', 'nanj', 'phase', 'pi', 
'polar', 'rect', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau']

常用的数学函数:https://www.w3cschool.cn/python/python-numbers.html

发布了419 篇原创文章 · 获赞 94 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_43539599/article/details/104474988