Test also the sign bit of zero results.
authorBruno Haible <bruno@clisp.org>
Fri, 6 Apr 2007 21:15:32 +0000 (21:15 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 6 Apr 2007 21:15:32 +0000 (21:15 +0000)
ChangeLog
modules/frexp-tests
modules/frexpl-tests
modules/ldexpl-tests
tests/test-frexp.c
tests/test-frexpl.c
tests/test-ldexpl.c

index 8973068..3421488 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-04-06  Bruno Haible  <bruno@clisp.org>
 
+       * tests/test-frexp.c (main): Test also the sign bit of zero results.
+       * tests/test-frexpl.c (main): Likewise.
+       * tests/test-ldexpl.c (main): Likewise.
+       * modules/frexp-tests (Depends-on): Add signbit.
+       * modules/frexpl-tests (Depdends-on): Likewise.
+       * modules/ldexpl-tests (Depdends-on): Likewise.
+
+2007-04-06  Bruno Haible  <bruno@clisp.org>
+
        * modules/signbit-tests: New file.
        * tests/test-signbit.c: New file.
 
index 910b0db..efc3018 100644 (file)
@@ -3,6 +3,7 @@ tests/test-frexp.c
 
 Depends-on:
 isnan-nolibm
+signbit
 
 configure.ac:
 
index b9bcca8..572265d 100644 (file)
@@ -4,6 +4,7 @@ tests/test-frexpl.c
 Depends-on:
 fpucw
 isnanl-nolibm
+signbit
 
 configure.ac:
 
index 3b5efba..7421227 100644 (file)
@@ -4,6 +4,7 @@ tests/test-ldexpl.c
 Depends-on:
 fpucw
 isnanl-nolibm
+signbit
 
 configure.ac:
 
index 96c640f..7d2a275 100644 (file)
@@ -92,6 +92,7 @@ main ()
     mantissa = frexp (x, &exp);
     ASSERT (exp == 0);
     ASSERT (mantissa == x);
+    ASSERT (!signbit (mantissa));
   }
 
   { /* Negative zero.  */
@@ -101,6 +102,7 @@ main ()
     mantissa = frexp (x, &exp);
     ASSERT (exp == 0);
     ASSERT (mantissa == x);
+    ASSERT (signbit (mantissa));
   }
 
   for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0)
index 1bcde6e..fd2c7e0 100644 (file)
@@ -88,6 +88,7 @@ main ()
     mantissa = frexpl (x, &exp);
     ASSERT (exp == 0);
     ASSERT (mantissa == x);
+    ASSERT (!signbit (mantissa));
   }
 
   { /* Negative zero.  */
@@ -97,6 +98,7 @@ main ()
     mantissa = frexpl (x, &exp);
     ASSERT (exp == 0);
     ASSERT (mantissa == x);
+    ASSERT (signbit (mantissa));
   }
 
   for (i = 1, x = 1.0L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
index bc1aeae..c4f3581 100644 (file)
@@ -62,16 +62,16 @@ main ()
 
   { /* Positive zero.  */
     x = 0.0L;
-    y = ldexpl (x, 0); ASSERT (y == x);
-    y = ldexpl (x, 5); ASSERT (y == x);
-    y = ldexpl (x, -5); ASSERT (y == x);
+    y = ldexpl (x, 0); ASSERT (y == x); ASSERT (!signbit (x));
+    y = ldexpl (x, 5); ASSERT (y == x); ASSERT (!signbit (x));
+    y = ldexpl (x, -5); ASSERT (y == x); ASSERT (!signbit (x));
   }
 
   { /* Negative zero.  */
     x = -0.0L;
-    y = ldexpl (x, 0); ASSERT (y == x);
-    y = ldexpl (x, 5); ASSERT (y == x);
-    y = ldexpl (x, -5); ASSERT (y == x);
+    y = ldexpl (x, 0); ASSERT (y == x); ASSERT (signbit (x));
+    y = ldexpl (x, 5); ASSERT (y == x); ASSERT (signbit (x));
+    y = ldexpl (x, -5); ASSERT (y == x); ASSERT (signbit (x));
   }
 
   { /* Positive finite number.  */