C5_LOG

 LOG()
 Calculate the natural logarithm of a numeric value
------------------------------------------------------------------------------
 Syntax

     LOG(<nExp>) --> nNaturalLog

 Arguments

     <nExp> is a numeric value greater than zero to be converted to its
     natural logarithm.

 Returns

     LOG() returns the natural logarithm as a numeric value.  If <nExp> is
     less than or equal to zero, LOG() returns a numeric overflow (displayed
     as a row of asterisks).

 Description

     LOG() is a numeric function that calculates the natural logarithm of a
     number and is the inverse of EXP().  The natural logarithm has a base of
     e which is approximately 2.7183.  The LOG() function returns x in the
     following equation,

     e**x = y

     where y is the numeric expression used as the LOG() argument (i.e.,
     LOG(y) = x).  Due to mathematical rounding, the values returned by LOG()
     and EXP() may not agree exactly (i.e., EXP(LOG(x)) may not always equal
     x).

 Examples

     .  These examples demonstrate various results of LOG():

        ? LOG(10)                  // Result: 2.30
        ? LOG(10 * 2)            // Result: 3.00
        ? EXP(LOG(1))            // Result: 1.00
        ? LOG(2.71)               // Result: 1.00

     .  This example is a user-defined function that returns the base
        10 logarithm:

        FUNCTION Log10( nNumber )
        IF nNumber > 0
           RETURN LOG(nNumber)/LOG(10)
        ELSE
           RETURN NIL
        ENDIF

 Files   Library is CLIPPER.LIB.

See Also: EXP() SET DECIMALS SET FIXED

 

One response to “C5_LOG

  1. Pingback: C5_SET FIXED | 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 )

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.