Skip to contents

log computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base.

log1p(x) computes \(\log(1+x)\) accurately also for \(|x| \ll 1\).

exp computes the exponential function.

expm1(x) computes \(\exp(x) - 1\) accurately also for \(|x| \ll 1\).

Usage

# S4 method for class 'dbMatrix'
log(x, base = exp(1))

Arguments

x

a numeric or complex vector.

base

a positive or complex number: the base with respect to which logarithms are computed. Defaults to \(e\)=exp(1).