1 /* Replacement 'trionan.c', using Gnulib functions. */
6 /* Copied from gnulib/tests/infinity.h. */
8 /* Infinityd () returns a 'double' +Infinity. */
10 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
15 static double zero = 0.0;
19 # define Infinityd() (1.0 / 0.0)
22 /* Copied from gnulib/tests/nan.h. */
24 /* NaNd () returns a 'double' not-a-number. */
26 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
27 on the expression 0.0 / 0.0. */
28 #if defined __DECC || defined _MSC_VER
32 static double zero = 0.0;
36 # define NaNd() (0.0 / 0.0)
39 /* Copied from gnulib/tests/minus-zero.h. */
41 /* minus_zerod represents the value -0.0. */
43 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
44 ICC 10.0 has a bug when optimizing the expression -zero.
45 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
46 to PowerPC on Mac OS X 10.5. */
47 #if defined __hpux || defined __sgi || defined __ICC
49 compute_minus_zerod (void)
51 return -DBL_MIN * DBL_MIN;
53 # define minus_zerod compute_minus_zerod ()
55 static double minus_zerod = -0.0;
61 #define INFINITY Infinityd()
64 #define trio_pinf() INFINITY
65 #define trio_ninf() -INFINITY
66 #define trio_nan() NAN
67 #define trio_nzero() minus_zerod
69 #define trio_isnan(x) isnan(x)
70 #define trio_isinf(x) isinf(x)
71 #define trio_signbit(x) signbit(x)