From b17d7ac7df62c7c7f56fe857ed28151d8b0e4e28 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 26 Jan 2008 15:17:58 +0100 Subject: [PATCH] Rename isnan, applicable to 'double' only, to isnand. --- ChangeLog | 68 ++++++++++++++++++++++ MODULES.html.sh | 2 +- NEWS | 5 ++ lib/frexp.c | 6 +- lib/isfinite.c | 6 +- lib/isnand.c | 19 ++++++ lib/{isnan.h => isnand.h} | 14 +++-- lib/signbitd.c | 6 +- lib/vasnprintf.c | 14 ++--- m4/{isnan.m4 => isnand.m4} | 20 +++---- modules/fprintf-posix | 2 +- modules/frexp | 2 +- modules/frexp-nolibm | 2 +- modules/frexp-nolibm-tests | 2 +- modules/frexp-tests | 2 +- modules/isfinite | 2 +- modules/{isnan-nolibm => isnand-nolibm} | 11 ++-- .../{isnan-nolibm-tests => isnand-nolibm-tests} | 6 +- modules/round-tests | 2 +- modules/signbit | 2 +- modules/signbit-tests | 2 +- modules/snprintf-posix | 2 +- modules/sprintf-posix | 2 +- modules/trunc-tests | 2 +- modules/unistdio/u16-u16-vasnprintf | 2 +- modules/unistdio/u16-vasnprintf | 2 +- modules/unistdio/u32-u32-vasnprintf | 2 +- modules/unistdio/u32-vasnprintf | 2 +- modules/unistdio/u8-u8-vasnprintf | 2 +- modules/unistdio/u8-vasnprintf | 2 +- modules/unistdio/ulc-vasnprintf | 2 +- modules/vasnprintf-posix | 2 +- modules/vasprintf-posix | 2 +- modules/vfprintf-posix | 2 +- modules/vsnprintf-posix | 2 +- modules/vsprintf-posix | 2 +- tests/test-frexp.c | 6 +- tests/{test-isnan.c => test-isnand.c} | 30 +++++----- tests/test-round1.c | 6 +- tests/test-round2.c | 6 +- tests/test-trunc1.c | 6 +- tests/test-trunc2.c | 6 +- 42 files changed, 193 insertions(+), 92 deletions(-) create mode 100644 lib/isnand.c rename lib/{isnan.h => isnand.h} (77%) rename m4/{isnan.m4 => isnand.m4} (90%) rename modules/{isnan-nolibm => isnand-nolibm} (51%) rename modules/{isnan-nolibm-tests => isnand-nolibm-tests} (52%) rename tests/{test-isnan.c => test-isnand.c} (81%) diff --git a/ChangeLog b/ChangeLog index 9f7c35dd8..83bacd8ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,71 @@ +2008-01-26 Bruno Haible + + Rename isnan, applicable to 'double' only, to isnand. + * modules/isnand-nolibm: Renamed from modules/isnan-nolibm. + (Files): Add lib/isnand.h, lib/isnand.c. Remove lib/isnan.h. + (configure.ac): Update. + (Include): Replace "isnan.h" with "isnand.h". + * m4/isnand.m4: Renamed from m4/isnan.m4. + (gl_FUNC_ISNAND_NO_LIBM): Renamed from gl_FUNC_ISNAN_NO_LIBM. Set + HAVE_ISNAND_IN_LIBC instead of HAVE_ISNAN_IN_LIBC. Build isnand.c + instead of isnan.c. + * lib/isnand.h: Renamed from lib/isnan.h. Test HAVE_ISNAND_IN_LIBC + instead of HAVE_ISNAN_IN_LIBC. + (isnand): Renamed from isnan. + * lib/isnand.c: New file. + * modules/isnand-nolibm-tests: Renamed from modules/isnan-nolibm-tests. + (Files): Add tests/test-isnand.c. Remove tests/test-isnan.c. + (Makefile.am): Update. + * tests/test-isnand.c: Renamed from tests/test-isnan.c. + Include isnand.h instead of isnan.h. + (main): Test isnand instead of isnan. + * modules/fprintf-posix (Depends-on): Add isnand-nolibm, remove + isnan-nolibm. + * modules/frexp (Depends-on): Likewise. + * modules/frexp-tests (Depends-on): Likewise. + * modules/frexp-nolibm (Depends-on): Likewise. + * modules/frexp-nolibm-tests (Depends-on): Likewise. + * modules/isfinite (Depends-on): Likewise. + * modules/round-tests (Depends-on): Likewise. + * modules/signbit (Depends-on): Likewise. + * modules/signbit-tests (Depends-on): Likewise. + * modules/snprintf-posix (Depends-on): Likewise. + * modules/sprintf-posix (Depends-on): Likewise. + * modules/trunc-tests (Depends-on): Likewise. + * modules/unistdio/u8-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u16-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u32-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise. + * modules/unistdio/ulc-vasnprintf (Depends-on): Likewise. + * modules/vasnprintf-posix (Depends-on): Likewise. + * modules/vasprintf-posix (Depends-on): Likewise. + * modules/vfprintf-posix (Depends-on): Likewise. + * modules/vsnprintf-posix (Depends-on): Likewise. + * modules/vsprintf-posix (Depends-on): Likewise. + * lib/frexp.c: Include isnand.h instead of isnan.h. + (ISNAN): Set to isnand instead of isnan. + * lib/isfinite.c: Include isnand.h instead of isnan.h. + (gl_isfinited): Use isnand instead of isnan. + * lib/signbitd.c: Include isnand.h instead of isnan.h. + (gl_signbitd): Use isnand instead of isnan. + * lib/vasnprintf.c: Include isnand.h instead of isnan.h. + (is_infinite_or_zero, VASNPRINTF): Use isnand instead of isnan. + * tests/test-frexp.c: Include isnand.h instead of isnan.h. + (main): Use isnand instead of isnan. + * tests/test-round1.c: Include isnand.h. + (main): Use isnand instead of isnan. + * tests/test-round2.c: Include isnand.h instead of isnan.h. + (ISNAN): Set to isnand instead of isnan. + * tests/test-trunc1.c: Include isnand.h. + (main): Use isnand instead of isnan. + * tests/test-trunc2.c: Include isnand.h instead of isnan.h. + (equal): Use isnand instead of isnan. + * MODULES.html.sh (Mathematics ): Replace isnan-nolibm with + isnand-nolibm. + * NEWS: Mention the change. + 2008-01-25 Paul Eggert Bruno Haible diff --git a/MODULES.html.sh b/MODULES.html.sh index 53bf494b3..bf89f4b77 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -1984,8 +1984,8 @@ func_all_modules () func_module frexpl func_module frexpl-nolibm func_module isfinite - func_module isnan-nolibm func_module isnanf-nolibm + func_module isnand-nolibm func_module isnanl func_module isnanl-nolibm func_module ldexpl diff --git a/NEWS b/NEWS index 568d57af8..f541b6144 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,11 @@ User visible incompatible changes Date Modules Changes +2008-01-26 isnan-nolibm The module name is changed from isnan-nolibm to + isnand-nolibm. The include file is changed from + "isnan.h" to "isnand.h". The function that it + defines is changed from isnan() to isnand(). + 2008-01-14 strcasestr This module now replaces worst-case inefficient implementations; clients that use controlled needles and thus do not care about worst-case diff --git a/lib/frexp.c b/lib/frexp.c index ed4da8862..4fd081920 100644 --- a/lib/frexp.c +++ b/lib/frexp.c @@ -1,5 +1,5 @@ /* Split a double into fraction and mantissa. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -27,7 +27,7 @@ # include "isnanl-nolibm.h" # include "fpucw.h" #else -# include "isnan.h" +# include "isnand.h" #endif /* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater @@ -45,7 +45,7 @@ #else # define FUNC frexp # define DOUBLE double -# define ISNAN isnan +# define ISNAN isnand # define DECL_ROUNDING # define BEGIN_ROUNDING() # define END_ROUNDING() diff --git a/lib/isfinite.c b/lib/isfinite.c index 84dcd175a..e6489297f 100644 --- a/lib/isfinite.c +++ b/lib/isfinite.c @@ -1,5 +1,5 @@ /* Test for finite value (zero, subnormal, or normal, and not infinite or NaN). - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -19,8 +19,8 @@ #include -#include "isnan.h" #include "isnanf.h" +#include "isnand.h" #include "isnanl-nolibm.h" int gl_isfinitef (float x) @@ -30,7 +30,7 @@ int gl_isfinitef (float x) int gl_isfinited (double x) { - return !isnan (x) && x - x == 0.; + return !isnand (x) && x - x == 0.; } int gl_isfinitel (long double x) diff --git a/lib/isnand.c b/lib/isnand.c new file mode 100644 index 000000000..8e5bbb399 --- /dev/null +++ b/lib/isnand.c @@ -0,0 +1,19 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2008 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 . */ + +/* Written by Bruno Haible , 2008. */ + +#include "isnan.c" diff --git a/lib/isnan.h b/lib/isnand.h similarity index 77% rename from lib/isnan.h rename to lib/isnand.h index c67110431..c58697f17 100644 --- a/lib/isnan.h +++ b/lib/isnand.h @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -14,12 +14,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#if HAVE_ISNAN_IN_LIBC +#if HAVE_ISNAND_IN_LIBC /* Get declaration of isnan macro. */ # include +# ifdef isnan +# undef isnand +# define isnand(x) isnan ((double)(x)) +# endif #else /* Test whether X is a NaN. */ -# undef isnan -# define isnan rpl_isnan -extern int isnan (double x); +# undef isnand +# define isnand rpl_isnand +extern int isnand (double x); #endif diff --git a/lib/signbitd.c b/lib/signbitd.c index 8907766f2..8871de792 100644 --- a/lib/signbitd.c +++ b/lib/signbitd.c @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -20,7 +20,7 @@ #include #include -#include "isnan.h" +#include "isnand.h" #include "float+.h" #undef gl_signbitd @@ -45,7 +45,7 @@ gl_signbitd (double arg) #else /* This does not do the right thing for NaN, but this is irrelevant for most use cases. */ - if (isnan (arg)) + if (isnand (arg)) return 0; if (arg < 0.0) return 1; diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index f26b42be6..7e533be1f 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2008 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 @@ -95,7 +95,7 @@ #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL # include -# include "isnan.h" +# include "isnand.h" #endif #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL @@ -106,7 +106,7 @@ #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL # include -# include "isnan.h" +# include "isnand.h" # include "printf-frexp.h" #endif @@ -236,7 +236,7 @@ decimal_point_char () static int is_infinite_or_zero (double x) { - return isnan (x) || x + x == x; + return isnand (x) || x + x == x; } #endif @@ -2327,7 +2327,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE double arg = a.arg[dp->arg_index].a.a_double; - if (isnan (arg)) + if (isnand (arg)) { if (dp->conversion == 'A') { @@ -2676,7 +2676,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (dp->conversion == 'f' || dp->conversion == 'F') { double arg = a.arg[dp->arg_index].a.a_double; - if (!(isnan (arg) || arg + arg == arg)) + if (!(isnand (arg) || arg + arg == arg)) { /* arg is finite and nonzero. */ int exponent = floorlog10 (arg < 0 ? -arg : arg); @@ -3080,7 +3080,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { double arg = a.arg[dp->arg_index].a.a_double; - if (isnan (arg)) + if (isnand (arg)) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { diff --git a/m4/isnan.m4 b/m4/isnand.m4 similarity index 90% rename from m4/isnan.m4 rename to m4/isnand.m4 index de692e69a..4f747eae0 100644 --- a/m4/isnan.m4 +++ b/m4/isnand.m4 @@ -1,27 +1,27 @@ -# isnan.m4 serial 2 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# isnand.m4 serial 1 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl Check how to get or define isnan() without linking with libm. +dnl Check how to get or define isnand() without linking with libm. -AC_DEFUN([gl_FUNC_ISNAN_NO_LIBM], +AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM], [ AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm], - [gl_cv_func_isnan_no_libm], + [gl_cv_func_isnand_no_libm], [ AC_TRY_LINK([#include double x;], [return isnan (x);], - [gl_cv_func_isnan_no_libm=yes], - [gl_cv_func_isnan_no_libm=no]) + [gl_cv_func_isnand_no_libm=yes], + [gl_cv_func_isnand_no_libm=no]) ]) - if test $gl_cv_func_isnan_no_libm = yes; then - AC_DEFINE([HAVE_ISNAN_IN_LIBC], 1, + if test $gl_cv_func_isnand_no_libm = yes; then + AC_DEFINE([HAVE_ISNAND_IN_LIBC], 1, [Define if the isnan(double) function is available in libc.]) else - AC_LIBOBJ([isnan]) + AC_LIBOBJ([isnand]) gl_DOUBLE_EXPONENT_LOCATION fi ]) diff --git a/modules/fprintf-posix b/modules/fprintf-posix index 44588a95d..aaf5d6e5a 100644 --- a/modules/fprintf-posix +++ b/modules/fprintf-posix @@ -10,7 +10,7 @@ Depends-on: stdio fseterr vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/frexp b/modules/frexp index 92c635baf..7fae366db 100644 --- a/modules/frexp +++ b/modules/frexp @@ -7,7 +7,7 @@ m4/frexp.m4 Depends-on: math -isnan-nolibm +isnand-nolibm configure.ac: gl_FUNC_FREXP diff --git a/modules/frexp-nolibm b/modules/frexp-nolibm index 8026d76b7..6a909e972 100644 --- a/modules/frexp-nolibm +++ b/modules/frexp-nolibm @@ -7,7 +7,7 @@ m4/frexp.m4 Depends-on: math -isnan-nolibm +isnand-nolibm configure.ac: gl_FUNC_FREXP_NO_LIBM diff --git a/modules/frexp-nolibm-tests b/modules/frexp-nolibm-tests index c1a93da29..ec0f4c731 100644 --- a/modules/frexp-nolibm-tests +++ b/modules/frexp-nolibm-tests @@ -2,7 +2,7 @@ Files: tests/test-frexp.c Depends-on: -isnan-nolibm +isnand-nolibm signbit configure.ac: diff --git a/modules/frexp-tests b/modules/frexp-tests index adfe218ea..6982cf94e 100644 --- a/modules/frexp-tests +++ b/modules/frexp-tests @@ -2,7 +2,7 @@ Files: tests/test-frexp.c Depends-on: -isnan-nolibm +isnand-nolibm signbit configure.ac: diff --git a/modules/isfinite b/modules/isfinite index 6c77a0aa6..f122c5ad7 100644 --- a/modules/isfinite +++ b/modules/isfinite @@ -7,8 +7,8 @@ m4/isfinite.m4 m4/check-math-lib.m4 Depends-on: -isnan-nolibm isnanf-nolibm +isnand-nolibm isnanl-nolibm math extensions diff --git a/modules/isnan-nolibm b/modules/isnand-nolibm similarity index 51% rename from modules/isnan-nolibm rename to modules/isnand-nolibm index 101dd94f7..6bb8c7da3 100644 --- a/modules/isnan-nolibm +++ b/modules/isnand-nolibm @@ -1,22 +1,23 @@ Description: -isnan() function: test for NaN, without requiring libm. +isnand() function: test for NaN, without requiring libm. Files: -lib/isnan.h +lib/isnand.h +lib/isnand.c lib/isnan.c lib/float+.h -m4/isnan.m4 +m4/isnand.m4 Depends-on: fpieee configure.ac: -gl_FUNC_ISNAN_NO_LIBM +gl_FUNC_ISNAND_NO_LIBM Makefile.am: Include: -#include "isnan.h" +#include "isnand.h" License: LGPL diff --git a/modules/isnan-nolibm-tests b/modules/isnand-nolibm-tests similarity index 52% rename from modules/isnan-nolibm-tests rename to modules/isnand-nolibm-tests index 8b158fab9..cfe52b800 100644 --- a/modules/isnan-nolibm-tests +++ b/modules/isnand-nolibm-tests @@ -1,5 +1,5 @@ Files: -tests/test-isnan.c +tests/test-isnand.c Depends-on: @@ -7,6 +7,6 @@ configure.ac: gl_DOUBLE_EXPONENT_LOCATION Makefile.am: -TESTS += test-isnan -check_PROGRAMS += test-isnan +TESTS += test-isnand +check_PROGRAMS += test-isnand diff --git a/modules/round-tests b/modules/round-tests index d061431f1..a4d2a15ab 100644 --- a/modules/round-tests +++ b/modules/round-tests @@ -3,7 +3,7 @@ tests/test-round1.c tests/test-round2.c Depends-on: -isnan-nolibm +isnand-nolibm stdbool stdint fprintf-posix diff --git a/modules/signbit b/modules/signbit index 57ba15456..94b524a97 100644 --- a/modules/signbit +++ b/modules/signbit @@ -12,7 +12,7 @@ Depends-on: float math isnanf-nolibm -isnan-nolibm +isnand-nolibm isnanl-nolibm fpieee diff --git a/modules/signbit-tests b/modules/signbit-tests index e0ee2bdf1..e2c3cf71a 100644 --- a/modules/signbit-tests +++ b/modules/signbit-tests @@ -1,7 +1,7 @@ Files: tests/test-signbit.c m4/isnanf.m4 -m4/isnan.m4 +m4/isnand.m4 m4/isnanl.m4 Depends-on: diff --git a/modules/snprintf-posix b/modules/snprintf-posix index 679569fa5..106997b45 100644 --- a/modules/snprintf-posix +++ b/modules/snprintf-posix @@ -9,7 +9,7 @@ m4/printf.m4 Depends-on: snprintf vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/sprintf-posix b/modules/sprintf-posix index 4aaa2d46b..b5e8fcefd 100644 --- a/modules/sprintf-posix +++ b/modules/sprintf-posix @@ -9,7 +9,7 @@ m4/printf.m4 Depends-on: stdio vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/trunc-tests b/modules/trunc-tests index ade196477..621e76d42 100644 --- a/modules/trunc-tests +++ b/modules/trunc-tests @@ -4,7 +4,7 @@ tests/test-trunc2.c Depends-on: float -isnan-nolibm +isnand-nolibm stdbool stdint fprintf-posix diff --git a/modules/unistdio/u16-u16-vasnprintf b/modules/unistdio/u16-u16-vasnprintf index 9c3ec61d2..430c60d17 100644 --- a/modules/unistdio/u16-u16-vasnprintf +++ b/modules/unistdio/u16-u16-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf index 4a98d3c85..3f7c5ba16 100644 --- a/modules/unistdio/u16-vasnprintf +++ b/modules/unistdio/u16-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/u32-u32-vasnprintf b/modules/unistdio/u32-u32-vasnprintf index 062533d10..479a1382b 100644 --- a/modules/unistdio/u32-u32-vasnprintf +++ b/modules/unistdio/u32-u32-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf index 5bad1564d..5b7809851 100644 --- a/modules/unistdio/u32-vasnprintf +++ b/modules/unistdio/u32-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/u8-u8-vasnprintf b/modules/unistdio/u8-u8-vasnprintf index 072f95cfc..a36f50134 100644 --- a/modules/unistdio/u8-u8-vasnprintf +++ b/modules/unistdio/u8-u8-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf index 20eb19935..909073c9d 100644 --- a/modules/unistdio/u8-vasnprintf +++ b/modules/unistdio/u8-vasnprintf @@ -30,7 +30,7 @@ unistr/u16-strlen unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf index 30dc65d1f..504538b94 100644 --- a/modules/unistdio/ulc-vasnprintf +++ b/modules/unistdio/ulc-vasnprintf @@ -28,7 +28,7 @@ unistr/u16-strmblen unistr/u32-strlen unistr/u32-strmblen mbsnlen -isnan-nolibm +isnand-nolibm isnanl-nolibm frexpl-nolibm printf-frexp diff --git a/modules/vasnprintf-posix b/modules/vasnprintf-posix index 3d07c70f2..0eefa5802 100644 --- a/modules/vasnprintf-posix +++ b/modules/vasnprintf-posix @@ -8,7 +8,7 @@ m4/printf.m4 Depends-on: vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/vasprintf-posix b/modules/vasprintf-posix index fde988144..e60680041 100644 --- a/modules/vasprintf-posix +++ b/modules/vasprintf-posix @@ -8,7 +8,7 @@ m4/printf.m4 Depends-on: vasprintf vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/vfprintf-posix b/modules/vfprintf-posix index 52ab7ee5a..6282280c1 100644 --- a/modules/vfprintf-posix +++ b/modules/vfprintf-posix @@ -10,7 +10,7 @@ Depends-on: stdio fseterr vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/vsnprintf-posix b/modules/vsnprintf-posix index dbe640215..187dc32e7 100644 --- a/modules/vsnprintf-posix +++ b/modules/vsnprintf-posix @@ -9,7 +9,7 @@ m4/printf.m4 Depends-on: vsnprintf vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/modules/vsprintf-posix b/modules/vsprintf-posix index 0dc7ea23b..af02a5e96 100644 --- a/modules/vsprintf-posix +++ b/modules/vsprintf-posix @@ -9,7 +9,7 @@ m4/printf.m4 Depends-on: stdio vasnprintf -isnan-nolibm +isnand-nolibm isnanl-nolibm frexp-nolibm frexpl-nolibm diff --git a/tests/test-frexp.c b/tests/test-frexp.c index 9856ba041..47db2bec4 100644 --- a/tests/test-frexp.c +++ b/tests/test-frexp.c @@ -1,5 +1,5 @@ /* Test of splitting a double into fraction and mantissa. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -24,7 +24,7 @@ #include #include -#include "isnan.h" +#include "isnand.h" #define ASSERT(expr) \ do \ @@ -75,7 +75,7 @@ main () double mantissa; x = NaN (); mantissa = frexp (x, &exp); - ASSERT (isnan (mantissa)); + ASSERT (isnand (mantissa)); } { /* Positive infinity. */ diff --git a/tests/test-isnan.c b/tests/test-isnand.c similarity index 81% rename from tests/test-isnan.c rename to tests/test-isnand.c index 3541af4be..0bc0a26de 100644 --- a/tests/test-isnan.c +++ b/tests/test-isnand.c @@ -1,5 +1,5 @@ -/* Test of isnan() substitute. - Copyright (C) 2007 Free Software Foundation, Inc. +/* Test of isnand() substitute. + Copyright (C) 2007-2008 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 @@ -18,7 +18,7 @@ #include -#include "isnan.h" +#include "isnand.h" #include #include @@ -51,19 +51,19 @@ int main () { /* Finite values. */ - ASSERT (!isnan (3.141)); - ASSERT (!isnan (3.141e30)); - ASSERT (!isnan (3.141e-30)); - ASSERT (!isnan (-2.718)); - ASSERT (!isnan (-2.718e30)); - ASSERT (!isnan (-2.718e-30)); - ASSERT (!isnan (0.0)); - ASSERT (!isnan (-0.0)); + ASSERT (!isnand (3.141)); + ASSERT (!isnand (3.141e30)); + ASSERT (!isnand (3.141e-30)); + ASSERT (!isnand (-2.718)); + ASSERT (!isnand (-2.718e30)); + ASSERT (!isnand (-2.718e-30)); + ASSERT (!isnand (0.0)); + ASSERT (!isnand (-0.0)); /* Infinite values. */ - ASSERT (!isnan (1.0 / 0.0)); - ASSERT (!isnan (-1.0 / 0.0)); + ASSERT (!isnand (1.0 / 0.0)); + ASSERT (!isnand (-1.0 / 0.0)); /* Quiet NaN. */ - ASSERT (isnan (NaN ())); + ASSERT (isnand (NaN ())); #if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT /* Signalling NaN. */ { @@ -80,7 +80,7 @@ main () # endif m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)] |= (unsigned int) 1 << DBL_EXPBIT0_BIT; - ASSERT (isnan (m.value)); + ASSERT (isnand (m.value)); } #endif return 0; diff --git a/tests/test-round1.c b/tests/test-round1.c index 396fcc4b9..625b9ff36 100644 --- a/tests/test-round1.c +++ b/tests/test-round1.c @@ -1,5 +1,5 @@ /* Test of rounding to nearest, breaking ties away from zero. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -25,6 +25,8 @@ #include #include +#include "isnand.h" + #define ASSERT(expr) \ do \ { \ @@ -84,7 +86,7 @@ main () ASSERT (round (1.0 / 0.0) == 1.0 / 0.0); ASSERT (round (-1.0 / 0.0) == -1.0 / 0.0); /* NaNs. */ - ASSERT (isnan (round (NaN ()))); + ASSERT (isnand (round (NaN ()))); return 0; } diff --git a/tests/test-round2.c b/tests/test-round2.c index 47d818c1d..b3ae0c80b 100644 --- a/tests/test-round2.c +++ b/tests/test-round2.c @@ -1,5 +1,5 @@ /* Test of rounding to nearest, breaking ties away from zero. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -37,8 +37,8 @@ #ifdef USE_LONG_DOUBLE # error Long double not supported. #elif ! defined USE_FLOAT -# include "isnan.h" -# define ISNAN isnan +# include "isnand.h" +# define ISNAN isnand # define FUNCTION "round" # define DOUBLE_UINT uint64_t # define DOUBLE_BITS 64 diff --git a/tests/test-trunc1.c b/tests/test-trunc1.c index 58669035b..a2d6dd4b4 100644 --- a/tests/test-trunc1.c +++ b/tests/test-trunc1.c @@ -1,5 +1,5 @@ /* Test of rounding towards zero. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -23,6 +23,8 @@ #include #include +#include "isnand.h" + #define ASSERT(expr) \ do \ { \ @@ -76,7 +78,7 @@ main () ASSERT (trunc (1.0 / 0.0) == 1.0 / 0.0); ASSERT (trunc (-1.0 / 0.0) == -1.0 / 0.0); /* NaNs. */ - ASSERT (isnan (trunc (NaN ()))); + ASSERT (isnand (trunc (NaN ()))); return 0; } diff --git a/tests/test-trunc2.c b/tests/test-trunc2.c index f3238ffe2..c06846d31 100644 --- a/tests/test-trunc2.c +++ b/tests/test-trunc2.c @@ -1,5 +1,5 @@ /* Test of rounding towards zero. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -26,7 +26,7 @@ #include #include -#include "isnan.h" +#include "isnand.h" #define ASSERT(expr) \ do \ @@ -103,7 +103,7 @@ trunc_reference (DOUBLE x) static int equal (DOUBLE x, DOUBLE y) { - return (isnan (x) ? isnan (y) : x == y); + return (isnand (x) ? isnand (y) : x == y); } /* Test whether the result for a given argument is correct. */ -- 2.11.0