summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-21 21:49:51 +0100
committerBruno Haible <bruno@clisp.org>2010-12-21 22:49:52 +0100
commitcb33aca29894edd6d93b61676fac09666352f610 (patch)
treeebeb4599118e4daacf493a67584dd8f73ecab201
parent9b144e908f361bc95b309fd33bfa0bc09ae55cc7 (diff)
downloadgnulib-cb33aca29894edd6d93b61676fac09666352f610.tar.gz
New module 'floorl-ieee'.
* modules/floorl-ieee: New file. * modules/floorl-ieee-tests: New file. * tests/test-floorl-ieee.c: New file, based on tests/test-floorl.c. * tests/test-floorl.c (main): Remove signbit tests. * modules/floorl-tests (Depends-on): Remove signbit. * doc/posix-functions/floorl.texi: Mention the new module.
-rw-r--r--ChangeLog10
-rw-r--r--doc/posix-functions/floorl.texi2
-rw-r--r--modules/floorl-ieee23
-rw-r--r--modules/floorl-ieee-tests16
-rw-r--r--modules/floorl-tests1
-rw-r--r--tests/test-floorl-ieee.c37
-rw-r--r--tests/test-floorl.c2
7 files changed, 87 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a7c2d2e5d..d44643fb3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2010-12-21 Bruno Haible <bruno@clisp.org>
+ New module 'floorl-ieee'.
+ * modules/floorl-ieee: New file.
+ * modules/floorl-ieee-tests: New file.
+ * tests/test-floorl-ieee.c: New file, based on tests/test-floorl.c.
+ * tests/test-floorl.c (main): Remove signbit tests.
+ * modules/floorl-tests (Depends-on): Remove signbit.
+ * doc/posix-functions/floorl.texi: Mention the new module.
+
+2010-12-21 Bruno Haible <bruno@clisp.org>
+
New module 'round-ieee'.
* modules/round-ieee: New file.
* m4/round.m4 (gl_FUNC_ROUND): If gl_FUNC_ROUND_IEEE is also used, test
diff --git a/doc/posix-functions/floorl.texi b/doc/posix-functions/floorl.texi
index 1667ec88aa..2e37e8678c 100644
--- a/doc/posix-functions/floorl.texi
+++ b/doc/posix-functions/floorl.texi
@@ -4,7 +4,7 @@
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/floorl.html}
-Gnulib module: floorl
+Gnulib module: floorl or floorl-ieee
Portability problems fixed by Gnulib:
@itemize
diff --git a/modules/floorl-ieee b/modules/floorl-ieee
new file mode 100644
index 0000000000..372fee44eb
--- /dev/null
+++ b/modules/floorl-ieee
@@ -0,0 +1,23 @@
+Description:
+floorl() function according to ISO C 99 with IEC 60559.
+
+Files:
+
+Depends-on:
+floorl
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(FLOORL_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/floorl-ieee-tests b/modules/floorl-ieee-tests
new file mode 100644
index 0000000000..f60bbe68b6
--- /dev/null
+++ b/modules/floorl-ieee-tests
@@ -0,0 +1,16 @@
+Files:
+tests/test-floorl-ieee.c
+tests/minus-zero.h
+tests/macros.h
+
+Depends-on:
+fpucw
+float
+signbit
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-floorl-ieee
+check_PROGRAMS += test-floorl-ieee
+test_floorl_ieee_LDADD = $(LDADD) @FLOORL_LIBM@
diff --git a/modules/floorl-tests b/modules/floorl-tests
index e76adbcfe3..5273fb5a88 100644
--- a/modules/floorl-tests
+++ b/modules/floorl-tests
@@ -9,7 +9,6 @@ Depends-on:
fpucw
isnanl-nolibm
float
-signbit
configure.ac:
diff --git a/tests/test-floorl-ieee.c b/tests/test-floorl-ieee.c
new file mode 100644
index 0000000000..05e836e516
--- /dev/null
+++ b/tests/test-floorl-ieee.c
@@ -0,0 +1,37 @@
+/* Test of rounding towards negative 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 <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <math.h>
+
+#include "fpucw.h"
+#include "minus-zero.h"
+#include "macros.h"
+
+int
+main ()
+{
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ /* Zero. */
+ ASSERT (!signbit (floorl (0.0L)));
+ ASSERT (!!signbit (floorl (minus_zerol)) == !!signbit (minus_zerol));
+
+ return 0;
+}
diff --git a/tests/test-floorl.c b/tests/test-floorl.c
index 2675a9e5d5..84717f8beb 100644
--- a/tests/test-floorl.c
+++ b/tests/test-floorl.c
@@ -40,9 +40,7 @@ main ()
/* Zero. */
ASSERT (floorl (0.0L) == 0.0L);
- ASSERT (!signbit (floorl (0.0L)));
ASSERT (floorl (minus_zerol) == 0.0L);
- ASSERT (!!signbit (minus_zerol) == !!signbit (floorl (minus_zerol)));
/* Positive numbers. */
ASSERT (floorl (0.3L) == 0.0L);
ASSERT (floorl (0.7L) == 0.0L);