exp(3)
NAME
exp, expm1, log, log10, log1p, pow - exponential, logarithm, power
SYNOPSIS
#include <math.h>
double exp(double x)
double expm1(double x)
double log(double x)
double log10(double x)
double log1p(double x)
double pow(double x, double y)
DESCRIPTION
Exp returns the exponential function of x.
Expm1 returns exp(x)-1 accurately even for tiny x.
Log returns the natural logarithm of x.
Log10 returns the logarithm of x to base 10.
Log1p returns log(1+x) accurately even for tiny x.
Pow(x,y) returns x**y.
ERROR (due to Roundoff etc.)
exp(x), log(x), expm1(x), log(x) and log1p(x) are accurate to within an
ulp, and log10(x) to within about 2 ulps; an ulp is one Unit in the Last
Place. Pow(x,y) returns x**y nearly rounded. In particular
pow(integer,integer) always returns the correct integer provided it is
representable.
DIAGNOSTICS
exp(Inf) = Inf, exp(NaN) = NaN.
For a finite argument, only exp(0) = 1 is exact.
Overflow of exp(x) if x > 7.09782712893383973096e+02.
Underflow of exp(x) if x < -7.45133219101941108420e+02.
expm1(Inf) = Inf, expm1(NaN) = NaN, expm1(-Inf) = -1.
For a finite argument, only expm1(0) = 0 is exact.
Overflow of expm1(x) if x > 7.09782712893383973096e+02.
log(x) = NaN with signal if x < 0 (including -Inf).
log(NaN) = that NaN with no signal.
log(+Inf) = +Inf.
log(0) = -Inf with signal.
log10(x) = NaN with signal if x < 0.
log10(NaN) = that NaN with no signal.
log10(+Inf) = +Inf.
log10(0) = -Inf with signal.
log10(10**n) = n for n = 0, 1, ..., 22.
log1p(x) = NaN with signal if x < -1 (including -Inf).
log1p(NaN) = that NaN with no signal.
log1p(+Inf) = +Inf.
log1p(-1) = -Inf with signal.
pow([anything], 0) = 1
pow([anything], 1) = [that anything]
pow([anything], NaN) = NaN
pow(NaN, [anything except 0]) = NaN
pow(+[|x| > 1], +Inf) = +Inf
pow(+[|x| > 1], -Inf) = +0
pow(+[|x| < 1], +Inf) = +0
pow(+[|x| < 1], -Inf) = +Inf
pow(+1 , +Inf) = NaN
pow(+0, [+anything except 0, NaN]) = +0
pow(-0, [+anything except 0, NaN, odd integer]) = +0
pow(+0, [-anything except 0, NaN]) = +Inf
pow(-0, [-anything except 0, NaN, odd integer]) = +Inf
pow(-0, [odd integer]) = -( +0 ** [odd integer] )
pow(+Inf, [+anything except 0, NaN]) = +Inf
pow(+Inf, [-anything except 0, NaN]) = +0
pow(-Inf, [anything]) = -0 ** [-anything])
pow([-anything], [integer]) = (-1)**integer*(+anything**integer)
pow([-anything except 0 and Inf], [non-integer]) = NaN
NOTES
To guarantee log10(10**n) = n, where 10**n is normal, the rounding mode
must set to Round-to-Nearest. Log10 is monotonic on all binary break
points.
SEE ALSO
math(3).
AUTHOR
Kwok-Choi Ng, W. Kahan