FrExp (open)

Splits a value into a mantissa and an exponent

Syntax

LOADLIB "wh::float.whlib";

RECORD FUNCTION FrExp(FLOAT value)

Parameters

FLOAT value

The FLOAT value to take the mantissa and exponent from

Return value

RECORD

A RECORD containing the mantissa and exponent of @italic value

exponent

An INTEGER exponent

mantissa

A FLOAT fraction in the range [.5,1>

Description

This function calculates and returns a mantissa and an exponent in a RECORD, so that value = mantissa * pow(2, exponent).

Examples

// frexp_rec.mantissa = .75, frexp_rec.exponent = 2
RECORD frexp_rec := FrExp(3);