home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / vbcc / machines / amiga68k / libsrc / math / math_ieee / modf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-30  |  170 b   |  13 lines

  1. #include <math.h>
  2.  
  3. double modf(double x,double *p)
  4. {
  5.     if(x<0){
  6.         *p=ceil(x);
  7.         return(*p-x);
  8.     }else{
  9.         *p=floor(x);
  10.         return(x-*p);
  11.     }
  12. }
  13.