math
– mathematical functions¶
The math
module provides some basic mathematical functions for
working with floating-point numbers.
-
math.
e
:float¶ base of the natural logarithm
-
math.
pi
:float¶ the ratio of a circle’s circumference to its diameter
-
math.
frexp
(x: float) → Tuple[int, int]¶ Decomposes a floating-point number into its mantissa and exponent. The returned value is the tuple
(m, e)
such thatx == m * 2**e
exactly. Ifx == 0
then the function returns(0.0, 0)
, otherwise the relation0.5 <= abs(m) < 1
holds.