

exp()                  Mathematics Function                 exp()




Compute exponent

#include <math.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.

***** Example *****

The following  program prompts you for a  number, then prints the
value for it as returned by exp, pow, log, and log10.


#include <math.h>
#include <stdio.h>
#define display(x) dodisplay((double)(x), #x)



dodisplay(value, name)
double value; char *name;
{
        if (errno)
                perror(name);
        else
                printf("%10g %s\n", value, name);
        errno = 0;
}




main()
{
        extern char *gets();
        double x;
        char string[64];



        for(;;) {
                printf("Enter number: ");
                if(gets(string) == NULL)
                        break;
                x = atof(string);



                display(x);
                display(exp(x));
                display(pow(10.0,x));
                display(log(exp(x)));
                display(log10(pow(10.0,x)));
        }


COHERENT Lexicon                                           Page 1




exp()                  Mathematics Function                 exp()



}


***** See Also *****

errno, mathematics library

***** Diagnostics *****

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.














































COHERENT Lexicon                                           Page 2


