math -- 数学関数¶
このモジュールは、該当する :term:`CPython` モジュールのサブセットを実装しています。
詳しくはオリジナルの CPython ドキュメンテーションを参照してください: math.
math モジュールは浮動小数点数を扱うための基本的な数学関数を提供します。
注記: pyboard では、浮動小数点は 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)¶ 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)¶ 浮動小数点数を仮数部と指数部に分解します。返される値は
x == m * 2**eとなる(m, 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が非数(NaN: Not-a-Number)であればTrueを返します。
-
math.ldexp(x, exp)¶ x * (2**exp)を返します。
-
math.lgamma(x)¶ xのガンマ関数の自然対数を返します。
-
math.log(x)¶ xの自然対数を返します。
-
math.log10(x)¶ xの常用対数を返します。
-
math.log2(x)¶ xの2進対数を返します。
-
math.modf(x)¶ xの小数部分と整数部分の2つの浮動小数点数のタプルを返します。両方の戻り値は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 方向に丸めた整数を返します。