1 /* Macros for not-a-number.
2 Copyright (C) 2007-2012 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* NaNf () returns a 'float' not-a-number. */
20 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
21 on the expression 0.0 / 0.0. */
22 #if defined __DECC || defined _MSC_VER
26 static float zero
= 0.0f
;
30 # define NaNf() (0.0f / 0.0f)
34 /* NaNd () returns a 'double' not-a-number. */
36 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
37 on the expression 0.0 / 0.0. */
38 #if defined __DECC || defined _MSC_VER
42 static double zero
= 0.0;
46 # define NaNd() (0.0 / 0.0)
50 /* NaNl () returns a 'long double' not-a-number. */
52 /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
53 runtime type conversion.
54 The Microsoft MSVC 9 compiler chokes on the expression 0.0L / 0.0L. */
56 static long double NaNl ()
61 #elif defined _MSC_VER
65 static long double zero
= 0.0L;
69 # define NaNl() (0.0L / 0.0L)