Exponentials and Logarithms¶
-
exp(x)¶ Computes \(e^{x}\).
>>> exp(3) = 20.08553692318767 >>> exp(ln(3)) = 3
-
exp2(x)¶ Computes \(2^{x}\).
>>> exp2(3) = 8 >>> exp2(ln2(3)) = 3
-
expm1(x)¶ Computes \(e^{x} - 1\) in a way that is accurate for small \(x\).
>>> expm1(20) = 19.08553692318767 >>> expm1(0.01) = 0.01005016708416806 >>> expm1(ln(3)) = 2
-
ln(x)¶ Computes the natural logarithm \(\log_{e}{x}\).
>>> ln(20) = 2.995732273553991 >>> ln(exp(20)) = 20
-
ln2(x)¶ Computes the logarithm base \(2\), \(\log_{2}{x}\). Aliases:
log2.>>> ln2(8) = 3 >>> log2(exp2(8)) = 8
-
ln1p(x)¶ Computes \(\log_{e}(1 + x)\). Aliases:
log1p.>>> ln1p(8) = 2.19722457733622 >>> log1p(expm1(8)) = 8
-
log(x)¶ Computes the logarithm base \(10\), \(\log_{10}{x}\). Aliases:
log10.>>> log(100) = 2 >>> log10(10^3) = 3
-
log1pm(x)¶ Computes \(\log_{e}(1 + x) - x\).
>>> log1pm(5) = -3.208240530771945
-
logabs(x)¶ Computes \(\log_{e}|x|\).
>>> log1pm(5) = 1.09861228866811
-
logn(a, b)¶ computes \(\log_{b}{a}\)
>>> logn(2, 3) = 0.6309297535714574