frexp()

The mathLib.frexp() system function splits a number into a normalized fraction in the range of .5 to 1 (which is returned as the result) and a power of 2 (which is returned in exponent).

Syntax

  mathLib.frexp(
    numericVariable FLOAT in,
    exponent INT out)
  returns (result FLOAT)
numericVariable
Input can be any variable or expression that is assignment compatible with the FLOAT type (see "Assignment compatibility in EGL").
exponent
A power of 2 expressed as an INT value.
result
A normalized fraction expressed as a FLOAT value.

Example

  result = mathLib.frexp(myInput,myExponent);
  // myInput = result * 2**myExponent

Feedback