The math.frexp()
function returns the mantissa and the exponent of the input number in base 2.
math.frexp(x)
x |
An integer or a float. |
The function returns the mantissa and exponent of x
as a pair (m, e)
, where m
is a float with an absolute value between 0.5 (inclusive) and 1.0 (exclusive), and e
is an integer such that x == m * 2**e
. Where , m
is the mantissa and e
is the exponent.
A TypeError
is raised if x
is not an integer or a float.