exp - C math.h

C examples for math.h:exp

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the base-e exponential function of x, which is e raised to the power x: e^x.

Prototype

long double expl (long double x);
long double exp (long double x);
     double exp (double x);
      float expf (float x);
      float exp (float x);
     double exp (T x);           

Parameters

Parameter Description
x Value of the exponent.

Return Value

Exponential value of x.

Example

Demo Code


#include <stdio.h>
#include <math.h>

int main ()/*from   w  ww. j  a  va2s.com*/
{
  double param = 5.0;
  double result = exp (param);
  printf ("The exponential value of %f is %f.\n", param, result );
  return 0;
}

Related Tutorials