Mantissa()

Mantissa()

Evaluate the mantissa of a floating point number

Syntax

       Mantissa( <nFloatingPointNumber> ) --> nMantissa

Arguments

<nFloatingPointNumber> Designate any Harbour number.

Returns

Mantissa() returns the mantissa of the <nFloatingPointNumber> number.

Description

This function supplements Exponent() to return the mantissa of the <nFloatingPointNumber> number.

Notes

The mantissa value can be 0 or in the range of 1 to 2. The following calculation reproduces the original value: Mantissa( <nFloatingPointNumber> ) * 2 ˆ Exponent( <nFloatingPointNumber> ) = <nFloatingPointNumber>

Example

       Display the mantissa for the following values:
           ? Mantissa(0)            // Result:  0.00
           ? Mantissa(100)          // Result:  1.56
           ? Mantissa(INFINITY)     // Result:  2.00
           ? Mantissa(0.01)         // Result:  1.28
           ? Mantissa(-100)         // Result: -1.56
           ? Mantissa(-0.01)        // Result: -1.28
           ? Mantissa(-1.01)        // Result: -1.01
           ? Mantissa(-2.01)        // Result: -1.01

Compliance

Mantissa() is compatible with CT3’s Mantissa().

Platforms

All

Files

Source is exponent.c, library is libct.

Seealso

Exponent()

Advertisements

2 responses to “Mantissa()

  1. Pingback: Harbour All Functions – M | 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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s