Log

Description

Gets 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.

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

Examples

Example 1

This expression returns 2.302585092:

Log(10)

Example 2

This expression returns -.693147 ... :

Log(0.5)

Example 3

Both these expressions result in an error at runtime:

Log(0)
Log(-2)

See also