acos
math.acos(
x
)
acos(
x
)
=
arccos
x
反余弦函数
acosh
math.acosh(
x
)
acosh
(
𝑥
)
=
ln
(𝑥
+
√
𝑥
2
−
1)
反双曲余弦函数
asin
math.asin(
x
)
asin(
x
)
=
arcsin
x
反正弦函数
asinh
math.asinh(
x
)
asinh
(
𝑥
)
=
ln
(𝑥
+
√
𝑥
2
+
1)
反双曲正弦函数
atan
math.atan(
x
)
atan(
x
)
=
arctan
x
反正切函数
atan2
math.atan2(
x
,
y
)
atan2
(
𝑥 ,
𝑦
)
=
atan
(
𝑥
𝑦
)
atanh
math.atanh(
x
)
atanh(
x
)
=
arctanh(
x
)
反双曲正切函数
ceil
math.ceil(
x
)
返回
≥
x
的最小整数
与
floor
区别
copysign
math.copysign(
x
,
y
)
返回与
y
同号的
x
值
cos
math.cos(
x
)
cos(
x
)
=
cos
x
cosh
math.cosh(
x
)
cosh
(
𝑥
)
=
e
𝑥
+
e
−𝑥
2
双曲余弦函数
degrees
math.degrees(
x
)
将
x
(
弧度
)
转成角度
e
math.e
返回自然常数
e
=
2.71828…
erf
math.erf(
x
)
erf
(
𝑥
)
=
2
√
𝜋
×
∫
𝑒
−𝑡
2
𝑥
0
d𝑡
误差函数
erf(
∞
)=1
erfc
math.erfc(
x
)
erfc(
x
)
=
1
-
erf(
x
)
互补误差函数
exp
math.exp(
x
)
exp (
x
)
=
e
x
指数函数
expm1
math.expm1(
x
)
expm1(
x
)
=
e
x
-
1
1
是数字
fabs
math.fabs(
x
)
以浮点数形式返回
x
的绝对值
factorial
math.factorial(
x
)
返回
x
!
0!
=
1
floor
math.floor(
x
)
返回
≤
x
的最大整数
fmod
math.fmod(
x
,
y
)
以浮点数形式返回
x
对
y
的取余
frexp
math.frexp(
x
)
返回
(
m
,
n
)
,满足
x
=
m
×
2
n
其中
m
∈
(-1,0)
∪
(0,1)
,
n
∈
N*
注意区别
math.ldexp(
x
,
y
)
fsum
math.fsum([
x
, y , z , …])
以浮点数返回
x
+
y
+
z
+
…
gamma
math.gamma(
x
)
gamma
(
𝑥
)
=
∫
𝑡
𝑥−1
𝑒
−𝑡
+∞
0
d𝑡
伽马函数
Γ(
x
)
gcd
math.gcd(
x
,
y
)
返回两个数的最大公约数
Python3.x
独有
hypot
math.hypot(
x
,
y
)
hypot
(
𝑥 ,
𝑦
)
=
√𝑥
2
+
𝑦
2
inf
math.inf
返回
inf(
无穷
)
Python3.x
独有
isclose
math.isclose
(a , b , rel_tol , abs_tol)
判断
a
与
b
是否近似相等
Python3.x
独有
isfinite
math.isfinite(
x
)
判断
x
是否非
inf
或者
nan
Python3.x
独有
isinf
math.isinf(
x
)
判断
x
是否为
±
inf
isnan
math.isnan(
x
)
判断
x
是否为
nan
Not a Number