X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fscalblnl.c;h=249248311ec1bb9059dfcb63fe6e483194331ec5;hb=50ab48b035c2555e09cc9ac94c74f45b74b234f4;hp=b06c407e68461c898ad472d36c5b26d4edfc485b;hpb=75aab93ef75299e347be24f57223dc93f2af80a4;p=libc-test diff --git a/src/math/scalblnl.c b/src/math/scalblnl.c index b06c407..2492483 100644 --- a/src/math/scalblnl.c +++ b/src/math/scalblnl.c @@ -1,19 +1,22 @@ #include #include -#include "util.h" +#include "mtest.h" static struct li_l t[] = { #if LDBL_MANT_DIG == 53 #include "sanity/scalbln.h" +#include "special/scalbln.h" #elif LDBL_MANT_DIG == 64 #include "sanity/scalblnl.h" +#include "special/scalblnl.h" #endif }; int main(void) { + #pragma STDC FENV_ACCESS ON long double y; float d; int e, i, err = 0; @@ -21,17 +24,22 @@ 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 = scalblnl(p->x, p->i); - e = getexcept(); - if (!checkexcept(e, p->e, p->r)) { + e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); + + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalblnl(%La, %lld)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); err++; } d = ulperrl(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if (!checkcr(y, p->y, p->r)) { printf("%s:%d: %s scalblnl(%La, %lld) want %La got %La ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->i, p->y, y, d, d-p->dy, p->dy); err++;