diff --git a/src/math/llrint.c b/src/math/llrint.c index 3ad7540..ac8fea8 100644 --- a/src/math/llrint.c +++ b/src/math/llrint.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llrint(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/llrintf.c b/src/math/llrintf.c index 2f19d56..e8f5fa4 100644 --- a/src/math/llrintf.c +++ b/src/math/llrintf.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llrintf(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/llrintl.c b/src/math/llrintl.c index 91d5447..0fea06e 100644 --- a/src/math/llrintl.c +++ b/src/math/llrintl.c @@ -37,7 +37,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llrintl(%La) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/llround.c b/src/math/llround.c index 403fa23..62f1a4e 100644 --- a/src/math/llround.c +++ b/src/math/llround.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llround(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/llroundf.c b/src/math/llroundf.c index 34c0ceb..d4256f5 100644 --- a/src/math/llroundf.c +++ b/src/math/llroundf.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llroundf(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/llroundl.c b/src/math/llroundl.c index 8c1fdc8..a2cd6f0 100644 --- a/src/math/llroundl.c +++ b/src/math/llroundl.c @@ -37,7 +37,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s llroundl(%La) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lrint.c b/src/math/lrint.c index 0d4bf85..695c3ed 100644 --- a/src/math/lrint.c +++ b/src/math/lrint.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lrint(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lrintf.c b/src/math/lrintf.c index 9e2ac07..06fc366 100644 --- a/src/math/lrintf.c +++ b/src/math/lrintf.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lrintf(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lrintl.c b/src/math/lrintl.c index bdb5d20..5091b1b 100644 --- a/src/math/lrintl.c +++ b/src/math/lrintl.c @@ -37,7 +37,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lrintl(%La) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lround.c b/src/math/lround.c index 7041288..36d3907 100644 --- a/src/math/lround.c +++ b/src/math/lround.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lround(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lroundf.c b/src/math/lroundf.c index 2f9a491..9852964 100644 --- a/src/math/lroundf.c +++ b/src/math/lroundf.c @@ -31,7 +31,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lroundf(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/lroundl.c b/src/math/lroundl.c index baa12e3..1a66be5 100644 --- a/src/math/lroundl.c +++ b/src/math/lroundl.c @@ -37,7 +37,7 @@ int main(void) printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lroundl(%La) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++; diff --git a/src/math/remquo.c b/src/math/remquo.c index 245cd1d..a3b6c92 100644 --- a/src/math/remquo.c +++ b/src/math/remquo.c @@ -33,7 +33,9 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r) || (yi & 7) != (p->i & 7) || (yi < 0) != (p->i < 0)) { + if (!checkulp(d, p->r) || + (!isnan(p->y) && (yi & 7) != (p->i & 7)) || + (!isnan(p->y) && (yi < 0) != (p->i < 0))) { printf("%s:%d: %s remquo(%a,%a) want %a,%lld got %a,%d ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, p->i, y, yi, d, d-p->dy, p->dy); err++; diff --git a/src/math/remquof.c b/src/math/remquof.c index 933bc99..55cbe9d 100644 --- a/src/math/remquof.c +++ b/src/math/remquof.c @@ -33,7 +33,9 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r) || (yi & 7) != (p->i & 7) || (yi < 0) != (p->i < 0)) { + if (!checkulp(d, p->r) || + (!isnan(p->y) && (yi & 7) != (p->i & 7)) || + (!isnan(p->y) && (yi < 0) != (p->i < 0))) { printf("%s:%d: %s remquof(%a,%a) want %a,%lld got %a,%d ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, p->i, y, yi, d, d-p->dy, p->dy); err++; diff --git a/src/math/remquol.c b/src/math/remquol.c index c37fda2..6a75008 100644 --- a/src/math/remquol.c +++ b/src/math/remquol.c @@ -33,7 +33,9 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r) || (yi & 7) != (p->i & 7) || (yi < 0) != (p->i < 0)) { + if (!checkulp(d, p->r) || + (!isnan(p->y) && (yi & 7) != (p->i & 7)) || + (!isnan(p->y) && (yi < 0) != (p->i < 0))) { printf("%s:%d: %s remquol(%La,%La) want %La,%lld got %La,%d ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, p->i, y, yi, d, d-p->dy, p->dy); err++; diff --git a/src/math/y0.c b/src/math/y0.c index d098064..f175f62 100644 --- a/src/math/y0.c +++ b/src/math/y0.c @@ -33,7 +33,7 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s y0(%a) want %a got %a ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy); err++; diff --git a/src/math/y0f.c b/src/math/y0f.c index 63880fb..b1c43b9 100644 --- a/src/math/y0f.c +++ b/src/math/y0f.c @@ -33,7 +33,7 @@ int main(void) err++; } d = ulperrf(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s y0f(%a) want %a got %a ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy); err++; diff --git a/src/math/y1.c b/src/math/y1.c index 95d971c..4aaf032 100644 --- a/src/math/y1.c +++ b/src/math/y1.c @@ -33,7 +33,7 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s y1(%a) want %a got %a ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy); err++; diff --git a/src/math/y1f.c b/src/math/y1f.c index 6871d67..df63f85 100644 --- a/src/math/y1f.c +++ b/src/math/y1f.c @@ -33,7 +33,7 @@ int main(void) err++; } d = ulperrf(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s y1f(%a) want %a got %a ulperr %.3f = %a + %a\n", p->file, p->line, rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy); err++; diff --git a/src/math/yn.c b/src/math/yn.c index 9763c40..cc4f2fe 100644 --- a/src/math/yn.c +++ b/src/math/yn.c @@ -32,7 +32,7 @@ int main(void) err++; } d = ulperr(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s yn(%a, %lld) want %a got %a, 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++; diff --git a/src/math/ynf.c b/src/math/ynf.c index e52ad6d..f19bb8b 100644 --- a/src/math/ynf.c +++ b/src/math/ynf.c @@ -32,7 +32,7 @@ int main(void) err++; } d = ulperrf(y, p->y, p->dy); - if (!checkulp(d, p->r)) { + if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { printf("%s:%d: %s ynf(%a, %lld) want %a got %a, 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++;