1 1.1 christos /* Test for NaN that does not need libm. 2 1.1.1.2 christos Copyright (C) 2007-2022 Free Software Foundation, Inc. 3 1.1 christos 4 1.1.1.2 christos This file is free software: you can redistribute it and/or modify 5 1.1.1.2 christos it under the terms of the GNU Lesser General Public License as 6 1.1.1.2 christos published by the Free Software Foundation; either version 2.1 of the 7 1.1.1.2 christos License, or (at your option) any later version. 8 1.1 christos 9 1.1.1.2 christos This file is distributed in the hope that it will be useful, 10 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 11 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 1.1.1.2 christos GNU Lesser General Public License for more details. 13 1.1 christos 14 1.1.1.2 christos You should have received a copy of the GNU Lesser General Public License 15 1.1 christos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 16 1.1 christos 17 1.1 christos #if HAVE_ISNANL_IN_LIBC 18 1.1 christos /* Get declaration of isnan macro or (older) isnanl function. */ 19 1.1 christos # include <math.h> 20 1.1.1.2 christos # if (__GNUC__ >= 4) || (__clang_major__ >= 4) 21 1.1.1.2 christos /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. 22 1.1.1.2 christos GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */ 23 1.1 christos # undef isnanl 24 1.1.1.2 christos # define isnanl(x) __builtin_isnan ((long double)(x)) 25 1.1 christos # elif defined isnan 26 1.1 christos # undef isnanl 27 1.1 christos # define isnanl(x) isnan ((long double)(x)) 28 1.1 christos # endif 29 1.1 christos #else 30 1.1 christos /* Test whether X is a NaN. */ 31 1.1 christos # undef isnanl 32 1.1 christos # define isnanl rpl_isnanl 33 1.1 christos extern int isnanl (long double x); 34 1.1 christos #endif 35