home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_09
/
9n09014a
< prev
next >
Wrap
Text File
|
1991-08-06
|
492b
|
24 lines
/* exp function */
#include "xmath.h"
double (exp)(double x)
{ /* compute exp(x) */
switch (_Dtest(&x))
{ /* test for special codes */
case NAN:
errno = EDOM;
return (x);
case INF:
errno = ERANGE;
return (DSIGN(x) ? 0.0 : _Inf._D);
case 0:
return (1.0);
default: /* finite */
if (0 <= _Exp(&x, 0))
errno = ERANGE;
return (x);
}
}
/* End of File */