math.frexp (x)

Returns m and e such that x=m2e, where e is an integer and the absolute value of m is in the range [0.5, 1] when x<>0 or m=0 when x=0.