2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
+ * mingwex/math/cephes_mconf.h (NAN, NANF, NANL):
+ Use GCC __builtin's if available.
+ (INFINITY, INFINITYF, INFINITYL): Likewise.
+
+2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
+
* mingwex/math/s_erf.c (erf): Set errno to ERANGE if
beyond approximation limit.
* mingwex/math/sf_erf.c (erff): Likewise.
#define PIO4 7.85398163397448309616E-1
#define NEGZERO (-0.0)
-extern double __INF;
+#undef NAN
#undef INFINITY
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITY __builtin_huge_val()
+#define NAN __builtin_nan("")
+#else
+extern double __INF;
#define INFINITY (__INF)
extern double __QNAN;
-#undef NAN
#define NAN (__QNAN)
-
+#endif
/*long double*/
#define MAXNUML 1.189731495357231765021263853E4932L
#define signbitl signbit
#define NEGZEROL (-0.0L)
+
+#undef NANL
+#undef INFINITYL
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITYL __builtin_huge_vall()
+#define NANL __builtin_nanl("")
+#else
extern long double __INFL;
#define INFINITYL (__INFL)
extern long double __QNANL;
#define NANL (__QNANL)
+#endif
/* float */
#define signbitf signbit
#define NEGZEROF (-0.0F)
+
+#undef NANF
+#undef INFINITYF
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITYF __builtin_huge_valf()
+#define NANF __builtin_nanf("")
+#else
extern float __INFF;
#define INFINITYF (__INFF)
extern float __QNANF;
#define NANF (__QNANF)
+#endif
/* double */