X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fremainder.c;h=4faa6d49a15589407583b14b89081c6e8c9078b1;hb=125fb69ba64c0064de25eb1a23217b00aa393051;hp=45321a5ffc7054a3bdb25f759f69308bdac9a094;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/remainder.c b/src/math/remainder.c index 45321a5..4faa6d4 100644 --- a/src/math/remainder.c +++ b/src/math/remainder.c @@ -9,6 +9,7 @@ static struct dd_d t[] = { int main(void) { + #pragma STDC FENV_ACCESS ON double y; float d; int e, i, err = 0; @@ -16,9 +17,14 @@ int main(void) for (i = 0; i < sizeof t/sizeof *t; i++) { p = t + i; - setupfenv(p->r); + + if (p->r < 0) + continue; + fesetround(p->r); + feclearexcept(FE_ALL_EXCEPT); y = remainder(p->x, p->x2); - e = getexcept(); + e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); + if (!checkexcept(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s remainder(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));