Python frexp function

Python frexp(x) function returns the mantissa and exponent as the pair(m,n) of x by solving x = m * 2**n, where 0.5 <= m < 1. It's a method of math module.

>>> import math
>>> math.frexp(3.4)
(0.85,2)
>>> math.frexp(0)
(0.0,0)
>>> math.frexp(4)
(0.5,3)
















endmemo.com © 2024  | Terms of Use | Privacy | Home