5 static struct d_dd t[] = {
6 #include "sanity/modf.h"
11 #pragma STDC FENV_ACCESS ON
17 for (i = 0; i < sizeof t/sizeof *t; i++) {
23 feclearexcept(FE_ALL_EXCEPT);
25 e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
27 if (!checkexcept(e, p->e, p->r)) {
28 printf("%s:%d: bad fp exception: %s modf(%a)=%a,%a, want %s",
29 p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e));
30 printf(" got %s\n", estr(e));
33 d = ulperr(y, p->y, p->dy);
34 di = ulperr(yi, p->y2, p->dy2);
35 if (!checkulp(d, p->r) || !checkulp(di, p->r)) {
36 printf("%s:%d: %s modf(%a) want %a,%a got %a,%a, ulperr %.3f = %a + %a, %.3f = %a + %a\n",
37 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);