X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fpow.c;h=473dea96b3c116c384a9814c4adafeb29cd463f5;hb=f3f0ff4782fc90bd0f3e48fd541ee431f76aaed1;hp=ef7129b5b3bdf5e3f39ae97aaa9748e078a8b68b;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/pow.c b/src/math/pow.c index ef7129b..473dea9 100644 --- a/src/math/pow.c +++ b/src/math/pow.c @@ -6,11 +6,13 @@ static struct dd_d t[] = { #include "crlibm/pow.h" #include "ucb/pow.h" #include "sanity/pow.h" +#include "special/pow.h" }; int main(void) { + #pragma STDC FENV_ACCESS ON double y; float d; int e, i, err = 0; @@ -18,9 +20,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 = pow(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 pow(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));