X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Flgammal_r.c;h=2ebe612aa22f41cf4745b716875aab13e313fe55;hb=588927eced2aa02855723750217fe3fc26404da9;hp=bfb8efcd113da1c4a313cc46171cd8d40efb82c5;hpb=75aab93ef75299e347be24f57223dc93f2af80a4;p=libc-test diff --git a/src/math/lgammal_r.c b/src/math/lgammal_r.c index bfb8efc..2ebe612 100644 --- a/src/math/lgammal_r.c +++ b/src/math/lgammal_r.c @@ -14,6 +14,7 @@ static struct l_li t[] = { int main(void) { + #pragma STDC FENV_ACCESS ON int yi; long double y; float d; @@ -22,9 +23,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 = lgammal_r(p->x, &yi); - e = getexcept(); + e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); + if (!checkexcept(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s lgammal_r(%La)=%La,%lld, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->i, estr(p->e));