math 数学函数¶
详见  math
math 模块提供一些用于处理浮点数的基本函数。
注意: 在pyboard,znzpi中,浮点数的精度为32位。
适用性:WiPy不适用。因为此模块需要支持浮点运算。
函数¶
- math.acos(x)¶
 返回
x的反余弦函数。
- math.acosh(x)¶
 返回
x的反双曲余弦函数。
- math.asin(x)¶
 返回
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)¶
 以
y的符号返回x。
- 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)¶
 返回
x以10为底的对数。
- math.log2(x)¶
 返回
x以2为底的对数
- 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的整数部分。
常量¶
- math.e¶
 自然函数的底
- math.pi¶
 圆的周长与其直径的比值