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 8973068d5776f6bd55cfe4cc95c9bde2866d5f31..3421488bc5894a6a46c872128fcd70cde3bc487a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
index 910b0db405c5fe33e4cec52966ef91295fef3d57..efc3018dcba564bbc5d8ccf521ad80c2dee7a5a5 100644 (file)
@@ -3,6 +3,7 @@ tests/test-frexp.c
 
 Depends-on:
 isnan-nolibm
+signbit
 
 configure.ac:
 
index b9bcca82c8331d91bfb71c247347284e3565685f..572265d077cb2882ffea66476285275bfdfd3a59 100644 (file)
@@ -4,6 +4,7 @@ tests/test-frexpl.c
 Depends-on:
 fpucw
 isnanl-nolibm
+signbit
 
 configure.ac:
 
index 3b5efba48a6fc6a1ec43ab6add82014f64d9537a..7421227ea80e41503542be3137327bd9bb608b47 100644 (file)
@@ -4,6 +4,7 @@ tests/test-ldexpl.c
 Depends-on:
 fpucw
 isnanl-nolibm
+signbit
 
 configure.ac:
 
index 96c640f7fcfb0bf2f26437d6e6de833ab39b6b21..7d2a2758ee09ffa5efd2cd76a2fc13b65e22bd1c 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 1bcde6e1b662de6843faf585d6af4c71ef42a9b1..fd2c7e07926cd52982108cd5523915b13bb82678 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 bc1aeae602518d40c2d3aa98e6d31f667fef9aff..c4f35811ab64914d49a3842eaf1105a0fbe98248 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.  */