-void test_modf()
-{
- double yf, yi;
- int i;
- for (i = 0; i < sizeof t/sizeof *t; i++) {
- yf = modf(t[i].x, &yi);
- if (!eq(yf,t[i].yf) || !eq(yi,t[i].yi))
- error("modf(%a) want %a %a got %a %a\n", t[i].x, t[i].yf, t[i].yi, yf, yi);
- }
-}
-void test_modff()
-{
- float yf, yi;
- int i;
- for (i = 0; i < sizeof tf/sizeof *tf; i++) {
- yf = modff(tf[i].x, &yi);
- if (!eq(yf,tf[i].yf) || !eq(yi,tf[i].yi))
- error("modff(%a) want %a %a got %a %a\n", tf[i].x, tf[i].yf, tf[i].yi, yf, yi);
- }
-}
-void test_modfl()
-{
- long double yf, yi;
- int i;
- for (i = 0; i < sizeof tl/sizeof *tl; i++) {
- yf = modfl(tl[i].x, &yi);
- if (!eq(yf,tl[i].yf) || !eq(yi,tl[i].yi))
- error("modfl(%La) want %La %La got %La %La\n", tl[i].x, tl[i].yf, tl[i].yi, yf, yi);
+ /* TODO: fix inexact */
+ if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+ printf("%s:%d: bad fp exception: %s modf(%a)=%a,%a, want %s",
+ p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e));
+ printf(" got %s\n", estr(e));
+ err++;
+ }
+ d = ulperr(y, p->y, p->dy);
+ di = ulperr(yi, p->y2, p->dy2);
+ if (!checkcr(y, p->y, p->r) || !checkcr(yi, p->y2, p->r)) {
+ printf("%s:%d: %s modf(%a) want %a,%a got %a,%a, ulperr %.3f = %a + %a, %.3f = %a + %a\n",
+ p->file, p->line, rstr(p->r), p->x, p->y, p->y2, y, yi, d, d-p->dy, p->dy, di, di-p->dy2, p->dy2);
+ err++;
+ }