summaryrefslogtreecommitdiff
path: root/tests/test-ceil-ieee.c
diff options
context:
space:
mode:
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;
+}