* modules/truncl-ieee: New file.
* modules/truncl-ieee-tests: New file.
* tests/test-truncl-ieee.c: New file, based on tests/test-truncl.c.
* tests/test-truncl.c (main): Remove signbit tests.
* modules/truncl-tests (Depends-on): Remove signbit.
* doc/posix-functions/truncl.texi: Mention the new module.
+2010-12-21 Bruno Haible <bruno@clisp.org>
+
+ New module 'truncl-ieee'.
+ * modules/truncl-ieee: New file.
+ * modules/truncl-ieee-tests: New file.
+ * tests/test-truncl-ieee.c: New file, based on tests/test-truncl.c.
+ * tests/test-truncl.c (main): Remove signbit tests.
+ * modules/truncl-tests (Depends-on): Remove signbit.
+ * doc/posix-functions/truncl.texi: Mention the new module.
+
2010-12-21 Bruno Haible <bruno@clisp.org>
New module 'ceill-ieee'.
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/truncl.html}
-Gnulib module: truncl
+Gnulib module: truncl or truncl-ieee
Portability problems fixed by Gnulib:
@itemize
--- /dev/null
+Description:
+truncl() function according to ISO C 99 with IEC 60559.
+
+Files:
+
+Depends-on:
+truncl
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(TRUNCL_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Files:
+tests/test-truncl-ieee.c
+tests/minus-zero.h
+tests/macros.h
+
+Depends-on:
+fpucw
+float
+signbit
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-truncl-ieee
+check_PROGRAMS += test-truncl-ieee
+test_truncl_ieee_LDADD = $(LDADD) @TRUNCL_LIBM@
fpucw
isnanl-nolibm
float
-signbit
configure.ac:
--- /dev/null
+/* Test of rounding towards zero.
+ 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 (truncl (0.0L)));
+ ASSERT (!!signbit (truncl (minus_zerol)) == !!signbit (minus_zerol));
+
+ return 0;
+}
/* Zero. */
ASSERT (truncl (0.0L) == 0.0L);
- ASSERT (!signbit (truncl (0.0L)));
ASSERT (truncl (minus_zerol) == 0.0L);
- ASSERT (!!signbit (minus_zerol) == !!signbit (truncl (minus_zerol)));
/* Positive numbers. */
ASSERT (truncl (0.3L) == 0.0L);
ASSERT (truncl (0.7L) == 0.0L);