math
– Mathematical operation function¶
This module implements the corresponding CPython A subset of modules, as described below. See CPython Document for details:math.
This math
module provides some basic mathematical functions for dealing with float numbers.
Note: at pyboard,Float numbers have 32-bit accuracy.
Functions¶
-
math.
acos
(x)¶ returns arccosine value
x
.
-
math.
acosh
(x)¶ returns inverse hyperbolic cosine value
x
.
-
math.
asin
(x)¶ R arcsine returned
x
.
-
math.
asinh
(x)¶ inverse hyperbolic sine returned
x
.
-
math.
atan
(x)¶ returns inverse tangent
x
.
-
math.
atan2
(y, x)¶ returns main value of arctangent
y/x
.
-
math.
atanh
(x)¶ returns inverse hyperbolic tangent
x
.
-
math.
ceil
(x)¶ returns an integer,
x
Round to positive infinity.
-
math.
copysign
(x, y)¶ return
x
to the symbol ofy
.
-
math.
cos
(x)¶ returns cosine
x
.
-
math.
cosh
(x)¶ returns hyperbolic cosine value
x
.
-
math.
degrees
(x)¶ returns radian
x
convert to degrees.
-
math.
erf
(x)¶ returns error function
x
-
math.
erfc
(x)¶ returns complementary error function
x
.
-
math.
exp
(x)¶ returns exponent
x
.
-
math.
expm1
(x)¶ returns
exp(x) - 1
.
-
math.
fabs
(x)¶ returns absolute value
x
.
-
math.
floor
(x)¶ Returns an integer,
x
Round to negative infinity.
-
math.
fmod
(x, y)¶ Returned to the rest
x/y
.
-
math.
frexp
(x)¶
The float number is disintegrate into mantissa and exponent. The returned value is tuple (m, e)
as such x == m * 2**e
absolutely right. If x == 0
,then the function returns (0.0,0)
,if not 0.5 <= abs(m) < 1
.
-
math.
gamma
(x)¶ returns Gamma function
x
.
-
math.
isfinite
(x)¶ In case
x
is limited, then returnTrue
.
-
math.
isinf
(x)¶ In case
x
is unlimited, then returnTrue
.
-
math.
isnan
(x)¶ In case
x
not digital, then returnTrue
.
-
math.
ldexp
(x, exp)¶ returns
x * (2**exp)
.
-
math.
lgamma
(x)¶ returns the natural logarithm of gamma function
x
.
-
math.
log
(x)¶ returns the natural logarithm
x
.
-
math.
log10
(x)¶ returns the logarithm of base 10
x
.
-
math.
log2
(x)¶ returns the logarithm of base 2
x
.
-
math.
modf
(x)¶ returns a tuple of two float numbers, it’s a fraction of a number and an integral part of it `` x`` . Both return values have the same symbol
x
.
-
math.
radians
(x)¶ returns
x
convert degrees to radians.
-
math.
sin
(x)¶ returns sine
x
.
-
math.
sinh
(x)¶ returns hyperbola sine
x
.
-
math.
sqrt
(x)¶ returns square root
x
.
-
math.
tan
(x)¶ returns tangent value
x
.
-
math.
tanh
(x)¶ returns hyperbolic tangent
x
.
-
math.
trunc
(x)¶ returns an integer,
x
round to 0.