X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Flog2l.c;h=057886463032fc35a40a4f88e63ed7dd27362eb1;hb=c58b8e7cb29f954791ffd5bc2d97ddb4d4202d0c;hp=28e2b3fa59c3bbe112f6f405f043f80a1809a352;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/log2l.c b/src/math/log2l.c index 28e2b3f..0578864 100644 --- a/src/math/log2l.c +++ b/src/math/log2l.c @@ -6,15 +6,18 @@ static struct l_l t[] = { #if LDBL_MANT_DIG == 53 #include "crlibm/log2.h" #include "sanity/log2.h" +#include "special/log2.h" #elif LDBL_MANT_DIG == 64 #include "sanity/log2l.h" +#include "special/log2l.h" #endif }; int main(void) { + #pragma STDC FENV_ACCESS ON long double y; float d; int e, i, err = 0; @@ -22,9 +25,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 = log2l(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 log2l(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));