X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fexpf.c;h=639108747ee95740b263ed0efd959d0c569be0c0;hb=b8fbda354afe84b26fae2317c49d79b3ff14f1cb;hp=f80c64b02e52a23e9d1feaf3374d5a8796826907;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/expf.c b/src/math/expf.c index f80c64b..6391087 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -5,11 +5,13 @@ 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));