MathLib.frexp function

MathLib.frexp splits a number into two components: a normalized fraction that ranges from .5 to 1, and an exponent that represents the power of 2. The fraction is the return value, and the exponent is the value returned to the second argument.

Package

eglx.lang

Syntax
static function frexp(value float in, exponent int out) returns(float);
value
Takes a numeric expression.
exponent
Takes a power of 2.

The returned fraction ranges from .5 to 1.

Example use

After the following code runs, the first argument equals the returned value multiplied by 2 to the power of the second argument:

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

In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.