eexxpp() -- Mathematics Function (libm)

Compute exponent
#iinncclluuddee <mmaatthh.hh>
ddoouubbllee eexxpp(_z) ddoouubbllee _z;

eexxpp() returns the exponential of _z, or _e^_z.

_E_x_a_m_p_l_e
The following  example, called aapprr.cc,  computes the annual  percentage rate
(APR) for a given rate of interest.  Compile it with the command:

    cc -f apr.c -lm

It is by Brent Seidel (brent_seidel@chthone.stat.com):

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

main()
{
    double rate, APR;
    char buffer[50];

    printf("Enter interest rate in percent (e.g., 12.9): ");
    fflush(stdout);

    if (gets(buffer) == NULL)
        exit(EXIT_FAILURE);
    rate = strtod(buffer);

    APR = (exp(rate/100.0) - 1) * 100.0;
    printf("The APR for %g%% compounded daily is %g%%\n", rate, APR);
}

_S_e_e _A_l_s_o
eerrrrnnoo, ffrreexxpp(), llddeexxpp(), lliibbmm
ANSI Standard, section 7.5.4.1
POSIX Standard, section 8.1

_D_i_a_g_n_o_s_t_i_c_s
eexxpp() indicates overflow by an eerrrrnnoo of EERRAANNGGEE and a huge returned value.
