×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2014.2439 | Released: 19 Sep 2014, 1:36am | What's New | Download Now

math.frexp()

Description:

Split a value into a normalized fraction and an exponent.

Syntax:

math.frexp (x)

Example:

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

Parameters:

x
A number.

Returns:

Two numbers:

  • a binary significand, a value between 0.5 (included) and 1.0 (excluded)
  • an integral exponent of 2
such that:

x = significand * 2exponent

If x is zero, both parts (significand and exponent) are zero.

Remarks:
Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    Corona SDK 1.0
  • Windows:
    Corona SDK 2.0
  • iOS:
    Corona SDK 1.0
  • Android:
    Corona SDK 2.0