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()
Pingback: Harbour All Functions – M | Viva Clipper !
Pingback: Harbour Math Functions | Viva Clipper !