home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_08
/
9n08014a
< prev
next >
Wrap
Text File
|
1991-07-10
|
458b
|
18 lines
/* modf function */
#include "xmath.h"
double (modf)(double x, double *pint)
{ /* compute modf(x, &intpart) */
*pint = x;
switch (_Dint(pint, 0))
{ /* test for special codes */
case NAN:
return (x);
case INF:
case 0:
return (0.0);
default: /* finite */
return (x - *pint);
}
}