[ top | up ]

Logarithms and Exponentials

Syntax

log(x)
log10(x)
log2(x)
exp(x)

Description

log computes natural logarithms, log10 computes common logarithms log2 computes binary (i.e. base 2) logarithms and exp computes the exponential function.

Each of these functions takes a single numeric or complex vector as argument and returns a vector of the same length containing the transformed values.

See Also

Trig, Math, Arithmetic.

Examples

log10(10^7) == 10^log10(7) log2(2^pi) == 2^log2(pi) Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps Mod(1+exp(pi*1i)) < .Machine$double.eps