数学関数
公式サイト:
math – 数学関数 | Python 3.x ドキュメント [公式]
使い方
参考:
Python の math モジュールを使ってみる | ネットワークエンジニアを目指して
指数/対数
math.e: 自然対数の底 (定数)math.exp: 指数関数math.log: 対数を計算するmath.log10: 常用対数を計算する
ドキュメント:
math.e | Python 3.x ドキュメント [公式]
math.exp | Python 3.x ドキュメント [公式]
math.log | Python 3.x ドキュメント [公式]
math.log10 | Python 3.x ドキュメント [公式]
参考:
exp / log / log10 / log2 – 指数関数/対数関数を計算 | note.nkmk.me
math.exp() Method | W3Swchools
math.log() Method | W3Swchools
math.log10() Method | W3Swchools
角度の変換
- math.degrees: ラジアンから度に変換する
 - math.radians: 度からラジアンに変換する
 
ドキュメント:
参考:
ラジアンと度数法単位の相互変換 | Python 数値計算入門
剰余
math.fmod: 浮動小数点で剰余を計算する
ドキュメント:
math.fmod | Python 3.x ドキュメント [公式]
三角波
参考:
Triangle wave shaped array in Python – Stack Overflow
数学関数一覧
math モジュールに含まれる関数
数論/数表現
- ceil
 - comb
 - copysign
 - fabs
 - factorial
 - floor
 - fmod
 - frexp
 - fsum
 - gcd
 - isclose
 - isfinite
 - isinf
 - isnan
 - isqrt
 - lcm
 - ldexp
 - modf
 - nextafter
 - perm
 - prod
 - remainder
 - sumprod
 - trunc
 - ulp
 
指数/対数
- cbrt
 - exp
 - exp2
 - expm1
 - log
 - log1p
 - log2
 - log10
 - pow
 - sqrt
 
三角関数
- acos
 - asin
 - atan
 - atan2
 - cos
 - dist
 - hypot
 - sin
 - tan
 
角度
- degrees
 - radians
 
双曲線関数
- acosh
 - asinh
 - atanh
 - cosh
 - sinh
 - tanh
 
特殊関数
- erf
 - erfc
 - gamma
 - lgamma
 
定数
- pi
 - e
 - tau
 - inf
 - nan