4 /* a replacement for modf that doesn't need the math library. Should
5 be portable, but slow */
6 static double my_modf(double x0, double *iptr)
15 if (l <= (x+1) && l >= (x-1)) break;
21 /* yikes! the number is beyond what we can handle. What do we do? */
30 ret = my_modf(x0-l*f, &i2);
39 static void test1(double x)
45 if (d1 != d2 || i1 != i2) {
46 printf("%f\t%f\n", d1, i1);
47 printf("%f\t%f\n", d2, i2);
54 test1(164976598.8749875);
55 test1(16497659895798297498763943987984.8749875);
56 test1(-8734987047074075050509709874000789.1749875);
57 test1(-16497659895798297498763943987984.8749875);
58 test1(8734903083084098487047074075050509709874000789.1749875);