From b210e4ccb6b1f8df2ff4155b6264473f1d26be78 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 5 Dec 2000 06:49:26 +0000 Subject: Update. * math/test-misc.c (main): Add a few more over and underflow tests for scalb. --- math/test-misc.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'math/test-misc.c') diff --git a/math/test-misc.c b/math/test-misc.c index 5140355..0dbb0882 100644 --- a/math/test-misc.c +++ b/math/test-misc.c @@ -17,6 +17,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include #include @@ -208,5 +209,47 @@ main (void) } #endif +#ifndef NO_LONG_DOUBLE + { + long double r; + + feclearexcept (FE_ALL_EXCEPT); + r = scalbl (LDBL_MIN, 2147483647); + if (! isinf (r)) + { + puts ("scalbl (LDBL_MIN, 2147483647) does not return Inf"); + result = 1; + } + else if (signbit (r) != 0) + { + puts ("scalbl (LDBL_MIN, 2147483647) returns -Inf"); + result = 1; + } + else if (fetestexcept (FE_UNDERFLOW)) + { + puts ("scalbl(NaN, 0) raises underflow exception"); + result = 1; + } + + feclearexcept (FE_ALL_EXCEPT); + r = scalbl (LDBL_MAX, -2147483647); + if (r != 0.0) + { + puts ("scalbl (LDBL_MAX, -2147483647) does not return 0"); + result = 1; + } + else if (signbit (r) != 0) + { + puts ("scalbl (LDBL_MAX, -2147483647) returns -Inf"); + result = 1; + } + else if (fetestexcept (FE_OVERFLOW)) + { + puts ("scalbl(NaN, 0) raises overflow exception"); + result = 1; + } + } +#endif + return result; } -- cgit v1.1