math.frexp()

Type Function
Library math.*
Return value Number
Revision Release 2024.3703
Keywords frexp, normalized fraction
See also math.ldexp()

Overview

Splits x into a normalized fraction and an exponent.

Returns two numbers:

Such that:

x = m * 2^e^

Syntax

math.frexp( x )
x (required)

Number. A number.

Examples

print(math.frexp(2))    ---> 0.5     2
print(math.frexp(3))    ---> 0.75    2
print(math.frexp(128))  ---> 0.5     8