Log

Returns the natural logarithm of a number. For an ErrorLogging object, this function can be used to write a string to the log file maintained by the object’s container.

To

Use

Determine the natural logarithm of a number

Syntax 1 For all objects

Write a string to a log file

Syntax 2 For ErrorLogging objects


Syntax 1 For all objects

Description

Determines the natural logarithm of a number.

Syntax

Log ( n ) 

Argument

Description

n

The number for which you want the natural logarithm (base e). The value of n must be greater than 0.

Returns

Double. Returns the natural logarithm of n. An execution error occurs if n is negative or zero. If n is null, Log returns null.

NoteInverse of Log The inverse of the Log function is the Exp function.

Examples

Example 1

This statement returns 2.302585092:

Log(10)

Example 2

This statement returns –.693147. . . :

Log(0.5)

Example 3

Both these statements result in an error during execution:

Log(0)

Log(-2)

Example 4

After the following statements execute, the value of a is 200:

double a, b =  Log(200)

a = Exp(b)// a = 200

See also


Syntax 2 For ErrorLogging objects

Description

Writes a string to the log file maintained by the object’s container.

Applies to

ErrorLogging objects

Syntax

errorlogobj.Log ( message )

Returns

None.