数字和数学模块¶
本章介绍的模块提供与数字和数学相关的函数和数据类型。 numbers
模块定义了数字类型的抽象层次结构。 math
和 cmath
模块包含浮点数和复数的各种数学函数。 decimal
模块支持使用任意精度算术的十进制数的精确表示。
本章包含以下模块的文档:
numbers
--- Numeric abstract base classesmath
--- Mathematical functionscmath
--- Mathematical functions for complex numbersdecimal
--- Decimal fixed point and floating point arithmeticfractions
--- Rational numbersrandom
--- Generate pseudo-random numbersstatistics
--- Mathematical statistics functions