math – 数学运算函数¶
这个模块实现了相应 CPython 模块的一个子集,如下所述。有关更多信息,请参阅原始CPython文档:math.
该 math 模块提供了一些处理浮点数的基本数学函数.
注意: 在pyboard上,浮点数具有32位精度.
Functions¶
-
math.acos(x)¶ 返回的反余弦值
x.
-
math.acosh(x)¶ 返回反双曲余弦值
x.
-
math.asin(x)¶ R返回反正弦
x.
-
math.asinh(x)¶ 返回反双曲正弦
x.
-
math.atan(x)¶ 返回反正切
x.
-
math.atan2(y, x)¶ 返回反正切的主值
y/x.
-
math.atanh(x)¶ 返回反双曲正切值
x.
-
math.ceil(x)¶ 返回一个整数,
x向正无穷大舍入.
-
math.copysign(x, y)¶ 回来
x的标志y.
-
math.cos(x)¶ 返回余弦
x.
-
math.cosh(x)¶ 返回的双曲余弦值
x.
-
math.degrees(x)¶ 返回弧度
x转换为度数.
-
math.erf(x)¶ 返回错误函数
x
-
math.erfc(x)¶ 返回互补误差函数
x.
-
math.exp(x)¶ 返回指数
x.
-
math.expm1(x)¶ 返回
exp(x) - 1.
-
math.fabs(x)¶ 返回绝对值
x.
-
math.floor(x)¶ 返回一个整数,
x向负无穷大舍入。
-
math.fmod(x, y)¶ 归还剩下的
x/y.
-
math.frexp(x)¶
将浮点数分解为尾数和指数。返回的值是元组 (m, e) 这样 x == m * 2**e
完全正确。如果 x == 0 ,则函数返回 (0.0,0) ,否则 0.5 <= abs(m) < 1 .
-
math.gamma(x)¶ 返回的伽玛函数
x.
-
math.isfinite(x)¶ 如果
x是有限,则返回True.
-
math.isinf(x)¶ 如果
x是无限,则返回True.
-
math.isnan(x)¶ 如果
x不是数字,则返回True.
-
math.ldexp(x, exp)¶ 返回
x * (2**exp).
-
math.lgamma(x)¶ 返回伽玛函数的自然对数
x.
-
math.log(x)¶ 返回自然对数
x.
-
math.log10(x)¶ 返回基数为10的对数
x.
-
math.log2(x)¶ 返回基数为2的对数
x.
-
math.modf(x)¶ 返回一个由两个浮点数组成的元组,它是数字的分数和不可分割的部分 `` x`` .两个返回值都具有相同的符号
x.
-
math.pow(x, y)¶ 返回
x `` 的 ``y次方.
-
math.radians(x)¶ 返回
x度转换为弧度.
-
math.sin(x)¶ 回归正弦
x.
-
math.sinh(x)¶ 返回双曲线的正弦曲线
x.
-
math.sqrt(x)¶ 返回平方根
x.
-
math.tan(x)¶ 返回正切值
x.
-
math.tanh(x)¶ 返回双曲正切值
x.
-
math.trunc(x)¶ 返回一个整数,
x向0舍入.