Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

expm1, expm1f, expm1l - Exponential function

&pagelevel(4)&pagelevel

Definition

#include <math.h>

double expm1(double x);
float expm1f(float x); (C11)
long double expm1l(long double x); (C11)

These functions compute ex-1.0

 Returnwert

e x-1

if successful.


HUGE_VAL
HUGE_VALF
HUGE_VALL

depending on the function type, if an overflow occurs. errno is set to ERANGE (result too large).

Notes

For small x values, the result of expm1(x) can be more accurate than the value of exp(x)-1.0. The functions expm1 and log1p are helpful for computing the expression ((1+x) n -1)/x, in the format:
expm1(n*log1p(x))/x in the case of very small values of x.

This function can also be used to precisely represent inverse hyperbolic functions.

Example

The following program calculates ex for an input value x.

See also

exp, log1p