Determines the exponent of a floating point number (base 2)

     EXPONENT(<nFloatingPointNumber>) --> nExponent


     <nFloatingPointNumber>  Designates any decimal number.


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


     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.


     .  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()).


     .  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()


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.