X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fcosh.c;h=493ff3467ad1281aa6f7b5ea34da2fb36c80a1b7;hb=b3580f11bf7b91afd597e6224c2f265d6d0b087f;hp=29f3ef53d13369aeb2468621dbde0d666dc6907e;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/cosh.c b/src/math/cosh.c index 29f3ef5..493ff34 100644 --- a/src/math/cosh.c +++ b/src/math/cosh.c @@ -6,11 +6,13 @@ static struct d_d t[] = { #include "crlibm/cosh.h" #include "ucb/cosh.h" #include "sanity/cosh.h" +#include "special/cosh.h" }; int main(void) { + #pragma STDC FENV_ACCESS ON double y; float d; int e, i, err = 0; @@ -18,9 +20,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 = cosh(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 cosh(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));