/* Return 1 if argument is a NaN, else 0.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library. If not, see
+ <https://www.gnu.org/licenses/>. */
/* Ugly kludge to avoid declarations. */
#define __isnanf not___isnanf
#define __GI___isnanf not__GI___isnanf
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef __isnanf
#undef isnanf
#undef __GI___isnanf
-/* The hidden_proto in include/math.h was obscured by the macro hackery. */
-__typeof (__isnan) __isnanf;
-hidden_proto (__isnanf)
-
-
int
__isnan (double x)
{
- return isunordered (x, x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ return ix * 2 > 0xffe0000000000000ul;
}
hidden_def (__isnan)
/* It turns out that the 'double' version will also always work for
single-precision. */
strong_alias (__isnan, __isnanf)
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
+weak_alias (__isnan, isnanf)
+
+/* ??? GCC 4.8 fails to look through chains of aliases with asm names
+ attached. Work around this for now. */
+hidden_ver (__isnan, __isnanf)
#ifdef NO_LONG_DOUBLE
strong_alias (__isnan, __isnanl)