X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Ferfc.c;h=799f79f862e7f9d308dac577141564ef3d323c09;hb=1d90e185c4ef9246e7e4bf02c3ee13cbd71dd7da;hp=fb9fe9b751c89e9036a81a1527609a675e84f934;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/erfc.c b/src/math/erfc.c index fb9fe9b..799f79f 100644 --- a/src/math/erfc.c +++ b/src/math/erfc.c @@ -1,14 +1,16 @@ #include #include -#include "util.h" +#include "mtest.h" static struct d_d t[] = { #include "sanity/erfc.h" +#include "special/erfc.h" }; int main(void) { + #pragma STDC FENV_ACCESS ON double y; float d; int e, i, err = 0; @@ -16,9 +18,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 = erfc(p->x); - e = getexcept(); + e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); + if (!checkexcept(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s erfc(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));