Python Math 第4页

Python math.factorial() 方法

阅读(715)

Python math.factorial(x) 方法返回 x 的阶乘。 参数只能是正整数。 一个数字的阶乘是所有整数的乘积之和,例如,6 的阶乘是: 6 x 5 x 4 x 3 x 2 x 1 = 720。 语法 math.factori...

Python math.fabs() 方法

阅读(491)

Python math.fabs(x) 方法返回 x 的绝对值。 绝对值是非负数,有负号会删除。 与 Python 内置的 abs() 不同,此方法始终将值转换为浮点值。 语法 math.fabs() 方法语法如下: math.fabs(x...

Python math.expm1() 方法

阅读(360)

Python math.expm1(x) 方法返回 e 的 x 次幂(次方)减 1,Ex - 1,其中 e = 2.718281... 是自然对数的基数。 math.expm1(x) 方法比调用 math.exp() 减去 1 更精确。 P...

Python math.exp() 方法

阅读(609)

Python math.exp(x) 方法返回 e 的 x 次幂(次方)Ex,其中 e = 2.718281... 是自然对数的基数。 Python 版本:1.6.1 语法 math.exp() 方法语法如下: math.exp(x) 参数...

Python math.erfc() 方法

阅读(379)

Python math.erfc(x) 方法返回 x 处的互补误差函数。 math.erfc(x) 方法接受 - inf 和 + inf 之间的值,并返回 - 1 到 + 1 之间的值。 Python 版本: 3.2 语法 math.erf...

Python math.erf() 方法

阅读(414)

Python math.erf(x) 方法返回一个数的误差函数 math.erf(x) 方法接受 - inf 和 + inf 之间的值,并返回 - 1 到 + 1 之间的值。 Python 版本:3.2 语法 math.erf() 方法语法...

Python math.dist() 方法

阅读(472)

Python math.dist(p, q) 方法返回 p 与 q 两点之间的欧几里得距离,以一个坐标序列(或可迭代对象)的形式给出。 两个点必须具有相同的维度。 传入的参数必须是正整数。 Python 版本:3.8 语法 math.dis...

Python math.degrees() 方法

阅读(393)

Python math.degrees(x) 方法将角度 x 从弧度转换为度数。 PI (3.14..) 弧度等于 180 度,也就是说 1 弧度等于 57.2957795 度。 math.radians() 方法将度数值转换为弧度。 Py...

Python math.cosh() 方法

阅读(463)

Python math.cosh(x) 返回 x 的双曲余弦值,相当于 (exp(number) + exp(-number)) / 2。 Python 版本: 1.4 语法 math.cosh() 方法语法如下: math.cosh(x)...

Python math.cos() 方法

阅读(395)

Python math.cos(x) 返回 x 弧度的余弦值。 Python 版本: 1.4 语法 math.cos() 方法语法如下: math.cos(x) 参数说明: x -- 必需,数字。如果 x 不是数字,则返回 TypeErro...