Format
#include <math.h> double exp(double x);
Language Level: ANSI, POSIX, XPG4
exp calculates the exponential function of a floating-point
argument x (e(x), where e equals
2.17128128...).
Return Value
If an overflow occurs, exp returns HUGE_VAL. If an
underflow occurs, it returns 0. Both overflow and underflow set
errno to ERANGE.
Example
This example calculates y as the exponential function of
x:
#include <math.h> #include <stdio.h>
int main(void)
{
double x, y;
x = 5.0; y = exp(x);
printf("exp( %lf ) = %lf\n", x, y);
/***************************************
The output should be:
exp( 5.000000 ) = 148.413159 ***************************************/ }
![]()
log -- Calculate Natural Logarithm
log10 -- Calculate Base 10 Logarithm
<math.h>