Important: The information in this document is obsolete and should not be used for new development.
exp
You can use theexp
function to raise e to some power.
double_t exp (double_t x);
x
- Any floating-point number.
DESCRIPTION
Theexp
function performs the exponential function on its argument.
The
log
function performs the inverse operation .EXCEPTIONS
When x is finite and nonzero, the result of might raise the following exceptions:
- inexact (for all finite, nonzero values of x)
- overflow (if the result is outside the range of the data type)
- underflow (if the result is inexact and must be represented as a denormalized number or 0)
SPECIAL CASES
Table 10-7 shows the results when the argument to theexp
function is a zero, a NaN, or an Infinity.
Special cases for the exp
functionOperation Result Exceptions raised +1 None +1 None NaN None[28] + None +0 None EXAMPLES
z = exp(0.0); /* z = e0 = 1. */ z = exp(1.0); /* z = e1 2.71828128 . . . The inexact exception is raised. */
[28] If the NaN is a signaling NaN, the invalid exception is raised.