From 581b1c58f176167b473c8e79ed7b3f1786adfd02 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 21 Dec 2010 21:58:44 +0100 Subject: [PATCH] New module 'ceill-ieee'. * modules/ceill-ieee: New file. * modules/ceill-ieee-tests: New file. * tests/test-ceill-ieee.c: New file, based on tests/test-ceill.c. * tests/test-ceill.c (main): Remove signbit tests. * modules/ceill-tests (Depends-on): Remove signbit. * doc/posix-functions/ceill.texi: Mention the new module. --- ChangeLog | 10 ++++++++++ doc/posix-functions/ceill.texi | 2 +- modules/ceill-ieee | 23 +++++++++++++++++++++++ modules/ceill-ieee-tests | 16 ++++++++++++++++ modules/ceill-tests | 1 - tests/test-ceill-ieee.c | 37 +++++++++++++++++++++++++++++++++++++ tests/test-ceill.c | 2 -- 7 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 modules/ceill-ieee create mode 100644 modules/ceill-ieee-tests create mode 100644 tests/test-ceill-ieee.c diff --git a/ChangeLog b/ChangeLog index d44643fb3..7e0c50200 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2010-12-21 Bruno Haible + New module 'ceill-ieee'. + * modules/ceill-ieee: New file. + * modules/ceill-ieee-tests: New file. + * tests/test-ceill-ieee.c: New file, based on tests/test-ceill.c. + * tests/test-ceill.c (main): Remove signbit tests. + * modules/ceill-tests (Depends-on): Remove signbit. + * doc/posix-functions/ceill.texi: Mention the new module. + +2010-12-21 Bruno Haible + New module 'floorl-ieee'. * modules/floorl-ieee: New file. * modules/floorl-ieee-tests: New file. diff --git a/doc/posix-functions/ceill.texi b/doc/posix-functions/ceill.texi index 5ab2fe7c2..1291327b4 100644 --- a/doc/posix-functions/ceill.texi +++ b/doc/posix-functions/ceill.texi @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ceill.html} -Gnulib module: ceill +Gnulib module: ceill or ceill-ieee Portability problems fixed by Gnulib: @itemize diff --git a/modules/ceill-ieee b/modules/ceill-ieee new file mode 100644 index 000000000..8566780e3 --- /dev/null +++ b/modules/ceill-ieee @@ -0,0 +1,23 @@ +Description: +ceill() function according to ISO C 99 with IEC 60559. + +Files: + +Depends-on: +ceill + +configure.ac: + +Makefile.am: + +Include: + + +Link: +$(CEILL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/ceill-ieee-tests b/modules/ceill-ieee-tests new file mode 100644 index 000000000..9c1efba65 --- /dev/null +++ b/modules/ceill-ieee-tests @@ -0,0 +1,16 @@ +Files: +tests/test-ceill-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +fpucw +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-ceill-ieee +check_PROGRAMS += test-ceill-ieee +test_ceill_ieee_LDADD = $(LDADD) @CEILL_LIBM@ diff --git a/modules/ceill-tests b/modules/ceill-tests index 65ddb7292..09ae4f32d 100644 --- a/modules/ceill-tests +++ b/modules/ceill-tests @@ -9,7 +9,6 @@ Depends-on: fpucw isnanl-nolibm float -signbit configure.ac: diff --git a/tests/test-ceill-ieee.c b/tests/test-ceill-ieee.c new file mode 100644 index 000000000..e7b541c83 --- /dev/null +++ b/tests/test-ceill-ieee.c @@ -0,0 +1,37 @@ +/* Test of rounding towards positive infinity. + Copyright (C) 2010 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +#include "fpucw.h" +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + /* Zero. */ + ASSERT (!signbit (ceill (0.0L))); + ASSERT (!!signbit (ceill (minus_zerol)) == !!signbit (minus_zerol)); + + return 0; +} diff --git a/tests/test-ceill.c b/tests/test-ceill.c index f627a9e29..cac45b77f 100644 --- a/tests/test-ceill.c +++ b/tests/test-ceill.c @@ -40,9 +40,7 @@ main () /* Zero. */ ASSERT (ceill (0.0L) == 0.0L); - ASSERT (!signbit (ceill (0.0L))); ASSERT (ceill (minus_zerol) == 0.0L); - ASSERT (!!signbit (minus_zerol) == !!signbit (ceill (minus_zerol))); /* Positive numbers. */ ASSERT (ceill (0.3L) == 1.0L); ASSERT (ceill (0.7L) == 1.0L); -- 2.11.0