summaryrefslogtreecommitdiff
path: root/tests/test-ceil-ieee.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-21 18:05:21 +0100
committerBruno Haible <bruno@clisp.org>2010-12-21 22:46:57 +0100
commit4b7ece979775e13ba4f1db1e6d9cfe400eff0f01 (patch)
treed02f5b3487819f1b912e46f677f085f57ff90aba /tests/test-ceil-ieee.c
parent8938f22cb374f04f265ac3a9d2cefdc44524d6e2 (diff)
downloadgnulib-4b7ece979775e13ba4f1db1e6d9cfe400eff0f01.tar.gz
New module 'ceil-ieee'.
* modules/ceil-ieee: New file. * m4/ceil.m4 (gl_FUNC_CEIL): Require gl_MATH_H_DEFAULTS. If gl_FUNC_CEIL_IEEE is also used, test whether ceil works according to ISO C 99 with IEC 60559. * m4/ceil-ieee.m4: New file. * modules/ceil (Files): Add lib/ceil.c. (Depends-on): Add 'float'. (configure.ac): Invoke gl_MATH_MODULE_INDICATOR. * lib/math.in.h (ceil): New declaration. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize GNULIB_CEIL, REPLACE_CEIL. * modules/math (Makefile.am): Substitute GNULIB_CEIL, REPLACE_CEIL. * modules/ceil-ieee-tests: New file. * tests/test-ceil-ieee.c: New file, based on tests/test-ceilf-ieee.c. * tests/test-math-c++.cc: Check the signature of 'ceil'. * doc/posix-functions/ceil.texi: Mention the new module.
Diffstat (limited to 'tests/test-ceil-ieee.c')
-rw-r--r--tests/test-ceil-ieee.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test-ceil-ieee.c b/tests/test-ceil-ieee.c
new file mode 100644
index 0000000000..06cfeff9e0
--- /dev/null
+++ b/tests/test-ceil-ieee.c
@@ -0,0 +1,32 @@
+/* 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 <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <math.h>
+
+#include "minus-zero.h"
+#include "macros.h"
+
+int
+main ()
+{
+ /* Zero. */
+ ASSERT (!signbit (ceil (0.0)));
+ ASSERT (!!signbit (ceil (minus_zerod)) == !!signbit (minus_zerod));
+
+ return 0;
+}