Home >>Python math Module >Python math.frexp() Method
Python math.frexp() method in python is used to returns a tuple of mantissa and exponent of a given specified number, where mantissa as a float value and exponent as an integer value.
This method is calculated by this: number = mantissa x 2 x x exponent (or number = m x 2e)
Syntax:math.frexp(x)
Parameter | Description |
---|---|
x | It is required a number to return the value. |
import math
print(math.frexp(2.9))
print(math.frexp(5))
import math
v = 4
w = 9
x = -7
y = -9.065
z = 12.06
print("frexp(v): ", math.frexp(v))
print("frexp(w): ", math.frexp(w))
print("frexp(x): ", math.frexp(x))
print("frexp(y): ", math.frexp(y))
print("frexp(z): ", math.frexp(z))