log

Natural logarithm

double log (
        double x
)

Arguments

x Argument

Return Value

The natural logarithm of x ( ln(x) ) is returned.

Explanation

The natural logarithm of x is calculated and the result is returned.

Notes

x must be greater than 0, otherwise an error will occur as shown below:

Condition Return value  Error
x < 0 0 Domain error
x == 0 1 Range error

See Also

exp(), log10()