X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fpowf.c;h=9709ec26184effac74633b3c3f67b41ea1fe2b51;hb=2113a3ed8217775797dd9a82aa420c10ef1712d5;hp=054671ac9270868888454cf11f4ac9dcf7f6a741;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/powf.c b/src/math/powf.c index 054671a..9709ec2 100644 --- a/src/math/powf.c +++ b/src/math/powf.c @@ -1,15 +1,17 @@ #include #include -#include "util.h" +#include "mtest.h" static struct ff_f t[] = { #include "ucb/powf.h" #include "sanity/powf.h" +#include "special/powf.h" }; int main(void) { + #pragma STDC FENV_ACCESS ON float y; float d; int e, i, err = 0; @@ -17,9 +19,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 = powf(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 powf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));