From a663c930196b50194921e7ee685d0704ac32f6f4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 26 Nov 2013 23:26:37 -0500 Subject: [PATCH] adjust fallback INFINITY definition for FLT_EVAL_METHOD==2 case on archs with excess precision, the floating point constant 1e40f may be evaluated such that it does not actually produce an infinity. 1e5000f is sufficiently large to produce an infinity for all supported floating point formats. note that this definition of INFINITY is only used for old or non-GNUC compilers anyway; despite being a portable, conforming definition, it leads to erroneous warnings on many compilers and thus using the builtin is preferred. --- include/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/math.h b/include/math.h index ec04a8a7..bbee62e2 100644 --- a/include/math.h +++ b/include/math.h @@ -16,7 +16,7 @@ extern "C" { #define INFINITY __builtin_inff() #else #define NAN (0.0f/0.0f) -#define INFINITY 1e40f +#define INFINITY 1e5000f #endif #define HUGE_VALF INFINITY -- 2.25.1