Full name
math.frexp
Library
math
Syntax
math.frexp(number)
Description
The math.frexp function returns two values m and e -mantissa and exponent- such that the number passed as an argument to the function is equal to m * (2 ** e).
Parameters
- number: Number to decompose
Result
The math.frexp function returns a real number.
Examples
If we apply the function to the number 11, we obtain the following values:
mantissa, exp = math.frexp(11)
mantissa, exp
(0.6875, 4)
Indeed we can check that mantissa * (2 ** exp) is equal to 11 (with real number format):
mantissa * (2 ** exp)
11.0