compute the exponential function of a number
#include <math.h> double exp( double x );
The exp() function computes the exponential function of x. A range error occurs if the magnitude of x is too large.
The exponential value.
When the argument is outside the permissible range, the matherr() function is called. Unless the default matherr() function is replaced, it will set the global variable errno to ERANGE, and print a "RANGE error" diagnostic message, using the stderr stream.
#include <stdio.h> #include <math.h> void main() { printf( "%f\n", exp(.5) ); }
produces the output:
1.648721
ANSI
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |