exp -- Compute the Exponential Function

SYNOPSIS

 #include <math.h>

 double exp(double x);
 

DESCRIPTION

exp computes the exponential function of its argument x. The result is e to the x power, where e is the base of natural logarithms, 2.71828 . . ..

The exponential function is the inverse of the natural logarithm and is expressed by this relation:

 r = e**x
 
x is a double-precision, floating-point number.

RETURN VALUE

exp returns the exponential function of its argument x, expressed as a
double-precision, floating-point number.

DIAGNOSTICS

If x is too large and the ensuing result is so large that it cannot be represented, exp returns HUGE_VAL. In this case, the run-time library writes an error message to the standard error file (stderr).

If an error occurs in exp, the _matherr routine is called. You can supply your own version of _matherr to suppress the diagnostic message or modify the value returned.

EXAMPLE

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

  #define XVAL 10.0

  main()
  {
     double y;

        /* Compute exponent function. */
     y = exp(-XVAL);
     printf("exp(-%f) = %fn", XVAL, y);
  }

 

RELATED FUNCTIONS

_matherr

SEE ALSO

Mathematical Functions

Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.