Mercurial > gnulib
diff tests/test-truncf1.c @ 29987:7bf583f1e789
Work around bug of HP-UX 10.20 cc with -0.0 literal.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 01 Aug 2008 11:30:27 +0200 |
parents | e4b084d57f9e |
children | e8d2c6fc33ad |
line wrap: on
line diff
--- a/tests/test-truncf1.c Thu Jul 31 15:35:25 2008 +0200 +++ b/tests/test-truncf1.c Fri Aug 01 11:30:27 2008 +0200 @@ -38,12 +38,16 @@ } \ while (0) +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f. + So we use -zero instead. */ +float zero = 0.0f; + int main () { /* Zero. */ ASSERT (truncf (0.0f) == 0.0f); - ASSERT (truncf (-0.0f) == 0.0f); + ASSERT (truncf (-zero) == 0.0f); /* Positive numbers. */ ASSERT (truncf (0.3f) == 0.0f); ASSERT (truncf (0.7f) == 0.0f);