Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>exponent()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 EXPONENT()
 Determines the exponent of a floating point number (base 2)
------------------------------------------------------------------------------
 Syntax

     EXPONENT(<nFloatingPointNumber>) --> nExponent

 Argument

     <nFloatingPointNumber>  Designates any decimal number.

 Returns

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

 Description

     CA-Clipper stores all numbers in a floating point format (called
     "double" in C).  EXPONENT() only returns exponents in this format, and
     they are always expressed in base 2.

 Note

     .  The expression EXPONENT(0) returns a value of 0.  However, the
        expression 20 returns a value of 1.  In this case, the mantissa must
        also equal 0 (see MANTISSA()).

 Examples

     .  The following calculation produces the original number:
        ^2 EXPONENT(nValue) * MANTISSA(nValue)= nValue

        ? EXPONENT(0)                     // Result:  0
        ? EXPONENT(INFINITY())            // Result:  1023
        ? EXPONENT(100)                   // Result:  6

     .  The sign for nValue will not be considered:

        ? EXPONENT(-100)                  // Result:  6
        ? EXPONENT(-1.01)                 // Result:  0
        ? EXPONENT(-2.01)                 // Result:  1

     .  Values in the range of -1 < nValue < +1, yield negative
        exponents regardless of the sign:

        ? EXPONENT(0.01)                  // Result:  -7
        ? EXPONENT(-0.01)                 // Result:  -7


See Also: MANTISSA()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson