EXPONENT()

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

Compliance

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

Platforms

All

Files

Source is exponent.c, library is libct.

Seealso

MANTISSA()

2 responses to “EXPONENT()

  1. Pingback: Harbour All Functions – E | Viva Clipper !

  2. Pingback: Harbour Math Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.