X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fexpf.c;h=e8f3f25a0a6a7614129e12f898b74295a1692f99;hb=99aee8a0c90251874b0f4725c614f6b0bbaa4011;hp=f80c64b02e52a23e9d1feaf3374d5a8796826907;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/expf.c b/src/math/expf.c index f80c64b..e8f3f25 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -1,15 +1,17 @@ #include #include -#include "util.h" +#include "mtest.h" static struct f_f t[] = { #include "ucb/expf.h" #include "sanity/expf.h" +#include "special/expf.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 = expf(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 expf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));