Copyright © 1997 The Open Group

expm1 - compute exponential functions

`#include <math.h> double expm1 (double`

x);

Theexpm1()function computese^{x}-1.0.

If

xis NaN, then the function returns NaN anderrnomay be set to EDOM.If

xis positive infinity,expm1()returns positive infinity.If

xis negative infinity,expm1()returns -1.0.If the value overflows,

expm1()returns HUGE_VAL and may seterrnoto ERANGE.

Theexpm1()function may fail if:

- [EDOM]
- The value of
xis NaN.- [ERANGE]
- The result overflows.

None.

The value ofexpm1(x) may be more accurate thanexp(x)-1.0 for small values ofx.The

expm1()andlog1p()functions are useful for financial calculations of ((1+x)^{n}-1)/x, namely:when

- expm1(
n* log1p(x))/xxis very small (for example, when calculating small daily interest rates). These functions also simplify writing accurate inverse hyperbolic functions.

None.

exp(),ilogb(),log1p(),<math.h>.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]