Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions / Exponential Functions


exp

You can use the exp function to raise e to some power.

double_t exp (double_t x);
x
Any floating-point number.
DESCRIPTION
The exp function performs the exponential function on its argument.

exp(x) = ex

The log function performs the inverse operation (lnex) .

EXCEPTIONS
When x is finite and nonzero, the result of exp(x) 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 the exp function is a zero, a NaN, or an Infinity.
Special cases for the exp function
OperationResultExceptions raised
exp(+0) +1None
exp(-0) +1None
exp(NaN) NaNNone[28]
exp(+ ) + None
exp(- ) +0None

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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996