Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>exponent()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
EXPONENT()

Syntax:     EXPONENT(<expN>)

Arguments:  <expN> can be any decimal number.

Returns:    A numeric value.
            Supplies the exponent of the number <expN> in base 2.

Usage:      Clipper stores all numbers in floating point format (called
            "double in C).  EXPONENT() will only return exponents
            contained in this format, which are always denoted to base 2.

Notes:      The expression EXPONENT(0) supplies a 0.  The expression
            2. will nevertheless produce 1.  The mantissa must in this
            special case be 0 (see MANTISSA()).

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * The following calculation will produce the
            * original number:

            * 2  EXPONENT(<expN>)*MANTISSA(<expN>) = <expN>

            ? EXPONENT(-)                       && Result: 0
            ? EXPONENT(INFINITY())              && Result: 1023
            ? EXPONENT(100)                     && Result: 6

            * The sign of <expN> will not be taken into
            * consideration.
            ? EXPONENT(-100)                    && Result: 6
            ? EXPONENT(-1.01)                   && Result: 0
            ? EXPONENT(-2.01)                   && Result: 1

            * The value in the range -1 < value < +1 will
            * produce negative exponents, regardless of the
            * preceding 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