Yes, INFINITY should be of type float (http://en.cppreference.com/w/cpp/numeric/math/INFINITY) and so should NAN (http://en.cppreference.com/w/cpp/numeric/math/NAN). The headers should be fixed with this patch:

Index: crt/math.h =================================================================== --- crt/math.h (revision 6638) +++ crt/math.h (working copy) @@ -349,16 +349,16 @@ _CRTIMP double __cdecl scalb (double, lo #if __MINGW_GNUC_PREREQ(3, 3) #define HUGE_VALF __builtin_huge_valf() #define HUGE_VALL __builtin_huge_vall() -#define INFINITY __builtin_inf() -#define NAN __builtin_nan("") +#define INFINITY HUGE_VALF +#define NAN __builtin_nanf("") #else extern const float __INFF; #define HUGE_VALF __INFF extern const long double __INFL; #define HUGE_VALL __INFL #define INFINITY HUGE_VALF -extern const double __QNAN; -#define NAN __QNAN +extern const double __QNANF; +#define NAN __QNANF #endif /* __MINGW_GNUC_PREREQ(3, 3) */ /* Use the compiler's builtin define for FLT_EVAL_METHOD to

(PS: using `HUGE_VALF`

, and thus `__builtin_huge_valf()`

, instead of `__builtin_inff()`

avoids a warning if floating-point mode didn't support infinities)