X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fcoshl.c;h=ffbbde909339eb36388e903cf76c35d256c63675;hb=db4b6cef06a63b1a43c654c3b98fe4e47fc7d411;hp=880737a57d27e74778b6944d102a5b5bf94a66c2;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/coshl.c b/src/math/coshl.c index 880737a..ffbbde9 100644 --- a/src/math/coshl.c +++ b/src/math/coshl.c @@ -7,15 +7,18 @@ static struct l_l t[] = { #include "crlibm/cosh.h" #include "ucb/cosh.h" #include "sanity/cosh.h" +#include "special/cosh.h" #elif LDBL_MANT_DIG == 64 #include "sanity/coshl.h" +#include "special/coshl.h" #endif }; int main(void) { + #pragma STDC FENV_ACCESS ON long double y; float d; int e, i, err = 0; @@ -23,9 +26,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 = coshl(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 coshl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));