From e7b6630b6be7be30b4cf393ff7c00a661281764e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 15 Oct 2014 08:29:00 +0200 Subject: [PATCH] gcc2: rewrite LDBL_MIN/MAX/EPSILON without hex-floats. * Values are taken from http://www.opengroup.org/csq/repository/appendix/oracle/iscl_appendix.html * Confirmed to give the same results as the constants used in gcc4 * Should work in C++, where gcc2 doesn't support hex-floats --- legacy/gcc/gcc/config/float-i386.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/gcc/gcc/config/float-i386.h b/legacy/gcc/gcc/config/float-i386.h index 120f544..7f3c298 100644 --- a/legacy/gcc/gcc/config/float-i386.h +++ b/legacy/gcc/gcc/config/float-i386.h @@ -74,7 +74,7 @@ #define LDBL_DIG 18 /* Difference between 1.0 and the minimum long double greater than 1.0 */ #undef LDBL_EPSILON -#define LDBL_EPSILON 0x1p-63l +#define LDBL_EPSILON 1.0842021724855044340075E-19L /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ #undef LDBL_MIN_EXP #define LDBL_MIN_EXP (-16381) @@ -89,7 +89,7 @@ #define LDBL_MAX_EXP 16384 /* Maximum long double */ #undef LDBL_MAX -#define LDBL_MAX 0xfffffffffffffffp16320l +#define LDBL_MAX 1.1897314953572317650213E+4932L /* Maximum int x such that 10**x is a representable long double */ #undef LDBL_MAX_10_EXP #define LDBL_MAX_10_EXP 4932 -- gitore 0.2.2