Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

exp, expf, expl - Exponential function

&pagelevel(4)&pagelevel

Definition

#include <math.h>

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

These functions calculate the exponential function for permissible floating-point numbers x.

 Returnwert

e x

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).

Example

The following program calculates ex for an input value x.

#include <math.h>
#include <stdio.h>
int main(void)
{
  double x;
  printf("Please enter a floating-point number:\n");
  if (scanf("%lf", &x) == 1)
      printf("exp(%g) = %g\n", x, exp(x));
  return 0;
}

See also

exp2, log, log2, log10, pow