浏览代码

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.
Rich Felker 11 年之前
父节点
当前提交
a663c93019
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/math.h

+ 1 - 1
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