From: Bruno Haible Date: Fri, 6 Apr 2007 21:15:32 +0000 (+0000) Subject: Test also the sign bit of zero results. X-Git-Tag: cvs-readonly~564 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=5d7e7dd737c62fe09ce0d083810a502209dc5e80;p=gnulib.git Test also the sign bit of zero results. --- diff --git a/ChangeLog b/ChangeLog index 8973068d5..3421488bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2007-04-06 Bruno Haible + * 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 + * modules/signbit-tests: New file. * tests/test-signbit.c: New file. diff --git a/modules/frexp-tests b/modules/frexp-tests index 910b0db40..efc3018dc 100644 --- a/modules/frexp-tests +++ b/modules/frexp-tests @@ -3,6 +3,7 @@ tests/test-frexp.c Depends-on: isnan-nolibm +signbit configure.ac: diff --git a/modules/frexpl-tests b/modules/frexpl-tests index b9bcca82c..572265d07 100644 --- a/modules/frexpl-tests +++ b/modules/frexpl-tests @@ -4,6 +4,7 @@ tests/test-frexpl.c Depends-on: fpucw isnanl-nolibm +signbit configure.ac: diff --git a/modules/ldexpl-tests b/modules/ldexpl-tests index 3b5efba48..7421227ea 100644 --- a/modules/ldexpl-tests +++ b/modules/ldexpl-tests @@ -4,6 +4,7 @@ tests/test-ldexpl.c Depends-on: fpucw isnanl-nolibm +signbit configure.ac: diff --git a/tests/test-frexp.c b/tests/test-frexp.c index 96c640f7f..7d2a2758e 100644 --- a/tests/test-frexp.c +++ b/tests/test-frexp.c @@ -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) diff --git a/tests/test-frexpl.c b/tests/test-frexpl.c index 1bcde6e1b..fd2c7e079 100644 --- a/tests/test-frexpl.c +++ b/tests/test-frexpl.c @@ -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) diff --git a/tests/test-ldexpl.c b/tests/test-ldexpl.c index bc1aeae60..c4f35811a 100644 --- a/tests/test-ldexpl.c +++ b/tests/test-ldexpl.c @@ -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. */