9. 数字和数学模块¶
本章介绍的模块提供与数字和数学相关的函数和数据类型。 numbers 模块定义了数字类型的抽象层次结构。 math 和 cmath 模块包含浮点数和复数的各种数学函数。 decimal 模块支持使用任意精度算术的十进制数的精确表示。
本章记录以下模块:
- 9.1.
numbers— Numeric abstract base classes - 9.2.
math— 数学函数 - 9.3.
cmath— Mathematical functions for complex numbers - 9.4.
decimal— 十进制定点和浮点运算 - 9.5.
fractions— 分数 - 9.6.
random— 生成伪随机数 - 9.7.
statistics— Mathematical statistics functions
