Mercurial > hg > octave-kai > gnulib-hg
changeset 8654:a2bc90a7b7aa
Test also the sign bit of zero results.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 06 Apr 2007 21:15:32 +0000 |
parents | 02c040ba84bf |
children | 9a272158fe43 |
files | ChangeLog modules/frexp-tests modules/frexpl-tests modules/ldexpl-tests tests/test-frexp.c tests/test-frexpl.c tests/test-ldexpl.c |
diffstat | 7 files changed, 22 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- a/modules/frexp-tests +++ b/modules/frexp-tests @@ -3,6 +3,7 @@ Depends-on: isnan-nolibm +signbit configure.ac:
--- a/modules/frexpl-tests +++ b/modules/frexpl-tests @@ -4,6 +4,7 @@ Depends-on: fpucw isnanl-nolibm +signbit configure.ac:
--- a/modules/ldexpl-tests +++ b/modules/ldexpl-tests @@ -4,6 +4,7 @@ Depends-on: fpucw isnanl-nolibm +signbit configure.ac:
--- a/tests/test-frexp.c +++ b/tests/test-frexp.c @@ -92,6 +92,7 @@ mantissa = frexp (x, &exp); ASSERT (exp == 0); ASSERT (mantissa == x); + ASSERT (!signbit (mantissa)); } { /* Negative zero. */ @@ -101,6 +102,7 @@ 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)
--- a/tests/test-frexpl.c +++ b/tests/test-frexpl.c @@ -88,6 +88,7 @@ mantissa = frexpl (x, &exp); ASSERT (exp == 0); ASSERT (mantissa == x); + ASSERT (!signbit (mantissa)); } { /* Negative zero. */ @@ -97,6 +98,7 @@ 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)
--- a/tests/test-ldexpl.c +++ b/tests/test-ldexpl.c @@ -62,16 +62,16 @@ { /* 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. */