home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_08
/
9n08014b
< prev
next >
Wrap
Text File
|
1991-07-10
|
579b
|
24 lines
/* frexp function */
#include "xmath.h"
double (frexp)(double x, int *pexp)
{ /* compute frexp(x, &i) */
short binexp;
switch (_Dunscale(&binexp, &x))
{ /* test for special codes */
case NAN:
case INF:
errno = EDOM;
*pexp = 0;
return (x);
case 0:
*pexp = 0;
return (0.0);
default: /* finite */
*pexp = binexp;
return (x);
}
}