EXPONENT()

Evaluate the exponent of a floating point number

Syntax

EXPONENT( <nFloatingPointNumber> ) --> nExponent

Arguments

<nFloatingPointNumber> Designate any Harbour number.

Returns

EXPONENT() returns the exponent of the <nFloatingPointNumber> number in base 2.

Description

This function supplements MANTISSA() to return the exponent of the <nFloatingPointNumber> number.

Values > 1 or values < -1 return a positive number 0 to 1023.

Values < 1 or values > -1 return a negative number -1 to -1023.

The EXPONENT( 0 ), return 0.

The following calculation reproduces the original value:

2^EXPONENT(<nFloatingPointNumber>) * MANTISSA(<nFloatingPointNumber>) = <nFloatingPointNumber>

TODO: add documentation

Status

Started

Compliance

EXPONENT() is compatible with CT3's EXPONENT()

Platforms

All

Files

Source is exponent.c, library is libct.

See Also