EXP(3M) — MATHEMATICAL FUNCTIONS
NAME
exp, expm1, exp2, exp10, log, log1p, log2, log10, pow − exponential, logarithm, power
SYNOPSIS
#include <math.h>
double exp(x)
double x;
double expm1(x)
double x;
double exp2(x)
double x;
double exp10(x)
double x;
double log(x)
double x;
double log1p(x)
double x;
double log2(x)
double x;
double log10(x)
double x;
double pow(x, y)
double x, y;
DESCRIPTION
exp returns the exponential function of x.
expm1 returns exp(x)−1 accurately even for tiny x.
exp2 and exp10 return 2.0∗∗x and 10.0∗∗x respectively.
log returns the natural logarithm of x.
log1p returns log(1+x) accurately even for tiny x.
log2 and log10 return the logarithm to base 2 and 10 respectively.
pow returns xy. pow(x,0.0) is 1 for all x, in conformance with 4.3BSD.
SEE ALSO
DIAGNOSTICS
All these functions handle exceptional arguments in the spirit of ANSI/IEEE Std 754-1985. Thus for x == ±0, log(x) is −∞ with a division by zero exception; for x < 0, including −∞, log(x) is a quiet NaN with an invalid operation exception; for x == +∞ or a quiet NaN, log(x) is x without exception; for x a signaling NaN, log(x) is a quiet NaN with an invalid operation exception; for x == 1, log(x) is 0 without exception; for any other positive x, log(x) is a normalized number with an inexact exception.
In addition, exp,exp2,exp10, log,log2,log10, and pow may also set errno and call matherr(3M).
Sun Release 3.2 — Last change: 20 October 1987