Manual Page Result
0
Command: log10 | Section: 3 | Source: Digital UNIX | File: log10.3.gz
exp(3) Library Functions Manual exp(3)
NAME
exp, expm1, log, log2, log10, log1p, pow - Exponential, logarithm, and
power functions
LIBRARY
Math Library (libm.a)
SYNOPSIS
#include <math.h>
double exp (double x); float expf (float x); double expm1 (dou-
ble x); float expm1f (float x); double log (double x); float logf
(float x); double log2 (double x); float log2f (float x); double
log10 (double x); float log10f (float x); double log1p (double y);
float log1pf (float y); double pow (double x, double y); float
powf (float x, float y);
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
exp(): XPG4
expm1(): XPG4-UNIX
log(): XPG4
log10(): XPG4
log1p(): XPG4-UNIX
pow(): XPG4
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
DESCRIPTION
The exp() and expf() functions compute the value of the exponential
function, defined as e**x, where e is the constant used as a base for
natural logarithms.
The expm1() and expm1f() functions compute exp(x) - 1 accurately, even
for tiny x.
The log() and logf() functions compute the natural (base e) logarithm
of x.
The log2() and log2f() functions compute the base 2 logarithm of x.
The log10() and log10f() functions compute the common (base 10) loga-
rithm of x.
The log1p() and log1pf() functions compute log(1+y) accurately, even
for tiny y.
The pow() and powf() functions raise a floating-point base x to a
floating-point exponent y. The value of pow(x,y) is computed as e**(y
ln(x)) for positive x. If x is 0 or negative, see your language refer-
ence manual.
Passing a NaN input value to pow() produces a NaN result for y not
equal to 0. For pow(NaN,0), see your language reference manual.
The following table describes function behavior in response to excep-
tional arguments:
tab(@); lfHB lfHB lfHB l l l . _
Function@Exceptional Argument@Routine Behavior
_
exp(), expf()@x > ln(max_float)@Overflow
exp(), expf()@x < ln(min_float)@Underflow
expm1(), expm1f()@x > ln(max_float)@Overflow
expm1(), expm1f()@x < ln(min_float)@Underflow
log(), logf()@x < 0@Invalid argument
log(), logf()@x = 0@Overflow
log2(), log2f()@x < 0@Invalid argument
log2(), logf2()@x = 0@Overflow
log10(), log10f()@x < 0@Invalid argument
log10(), log10f()@x = 0@Overflow
log1p(), log1pf()@1+y < 0@Invalid argument
log1p(), log1pf()@1+y = 0@Overflow
pow(), powf()@y ln(x) > ln(max_float)@Overflow
pow(), powf()@y ln(x) < ln(min_float)@Underflow
_
The following table lists boundary values used by these functions:
tab(@); lfHB lfHB lfHB lfHB lfHB lfHB lfHB lfHB l l l l . _
Value@Data@Hexadecimal Value@Decimal Value Name@Type
_
ln(max_float) @S_FLOAT @42B17218 @88.7228391
@T_FLOAT @40862E42FEFA39EF @709.7827128933840
ln(min_float) @S_FLOAT @C2CE8ED0 @-103.2789
@T_FLOAT @C0874385446D71C3 @-744.4400719213813
_ delim off
exp(3)