\Header{Log}{Logarithms and Exponentials}
\alias{log}{Log}
\alias{log10}{Log}
\alias{log2}{Log}
\alias{exp}{Log}
\keyword{math}{Log}
\begin{Usage}
\begin{verbatim}
log(x)
log(x, base)
log10(x)
log2(x)
exp(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] a numeric or complex vector.
\item[\texttt{base}] positive number. The base with respect to which
logarithms are computed.  Defaults to \eqn{e}{}=\texttt{exp(1)}.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{log} computes natural logarithms,
\texttt{log10} computes common (i.e., base 10) logarithms, and
\texttt{log2} computes binary (i.e., base 2) logarithms.
The general form \texttt{log(x, base)} computes logarithms with base
\texttt{base} (\texttt{log10} and \texttt{log2} are only special cases).

\texttt{exp} computes the exponential function.\end{Description}
\begin{Value}
A vector of the same length as \texttt{x} containing the transformed
values.\end{Value}
\begin{SeeAlso}
\texttt{\Link{Trig}}, \texttt{\Link{Math}}, \texttt{\Link{Arithmetic}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
log(exp(3))
all(log(1:10) ==log(1:10, exp(1)))
log10(30) == log(30, 10)
log10(1e7)# = 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
\end{ExampleCode}
\end{Examples}

