Exponential Functions

DESCRIPTION:
Returns the exponential, logarithm or squareroot of the input.

USAGE:
exp(x)
log(x, base=exp(1))
log10(x)
sqrt(x)

REQUIRED ARGUMENTS:
x:
numeric or complex. Missing values (NAs) are allowed.

OPTIONAL ARGUMENTS:
base:
(positive) numeric or complex base for logarithms.

VALUE:
data transformed by the specified function, with attributes preserved (e.g., a matrix remains a matrix). By default, log computes natural logs.

CLASSES:
This function will be used as the default method for classes that do not inherit a specifc method for the function or for the Math group of functions. The result will retain the class and the attributes. If this behavior is not appropriate, the designer of the class should provide a method for the function or for the Math group.

DETAILS:
Missing in input means output missing. Numeric arguments must be non-negative for log, log10 and sqrt, otherwise is returned and a warning message is generated; coerce the numbers to complex to avoid this.

These are members of the Math group of generic functions.

See section 5.1.5 of Becker, Chambers and Wilks for details on domains and branch cuts in the case of complex arguments.


SEE ALSO:
Complex , Arithmetic (for exponentiation).

EXAMPLES:
log(y, 2) # base 2 logarithms
log(100, 10) == log10(100)  #log10 computes the common logarithm

log(-3) # returns NA log(as.complex(-3)) # equals log(3) plus pi times i

acr <- seq(0, pi/2, len=50) exp((1i) * arc) # part of the unit circle in the complex plane

sqrt(2)