expm1()

Computes a power of e minus 1.

  #include <math.h>
  
  double expm1(double x);
  
  float expm1l(float x);
  
  long double expm1l(long double x);    
Parameter

x

A value from which to compute.

Remarks

This function returns eX - 1. This function may be more accurate than calling exp(x) and subtracting 1.0 from its result.

If x is too large, the function sets errno to ERANGE and fpclassify(exp2(x)) does not return FP_NORMAL.

This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.

Listing: Example of expm1() Usage

#include <math.h>

#include <stdio.h>

int main(void)

{

double j = 12;

printf("e^%f - 1 = %f\n",j,expm1(j));

return 0;

}

Output:

e^12.000000 - 1 = 162753.791419