Mercurial > hg > octave-lyh > gnulib-hg
changeset 9914:682e19d65658
Avoid negating 0.0L - it yields a wrong result on HP-UX/hppa.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 13 Apr 2008 21:20:17 +0200 |
parents | d3f5a70dc1ba |
children | 3dadfbdbc21a |
files | ChangeLog tests/test-signbit.c |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-13 Bruno Haible <bruno@clisp.org> + + Make test-signbit pass on HP-UX/hppa. + * tests/test-signbit.c (minus_zerol): New variable. + (test_signbitl): Use it. + 2008-04-13 Bruno Haible <bruno@clisp.org> Make truncl work on OSF/1 4.0.
--- a/tests/test-signbit.c +++ b/tests/test-signbit.c @@ -39,6 +39,9 @@ float zerof = 0.0f; double zerod = 0.0; long double zerol = 0.0L; +/* We cannot use the expression '-zerol' here, because on HP-UX/hppa it + evaluates to 0.0L, not -0.0L. */ +long double minus_zerol = -0.0L; static void test_signbitf () @@ -140,7 +143,7 @@ ASSERT (signbit (-2.718e-30L)); /* Zeros. */ ASSERT (!signbit (0.0L)); - if (1.0L / -zerol < 0) + if (1.0L / minus_zerol < 0) ASSERT (signbit (-0.0L)); else ASSERT (!signbit (-0.0L));