From 2a5cd7f7a5561b0bda54ed4993cea251af36e7af Mon Sep 17 00:00:00 2001 From: geoffk Date: Fri, 7 Jan 2005 00:19:23 +0000 Subject: * c-cppbuiltin.c (builtin_define_float_constants): Set __*_EPSILON__ for IBM long double format correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93021 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-cppbuiltin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/c-cppbuiltin.c') diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index cedf9e7a46e..2c9039ef45f 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -219,7 +219,12 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**(1-p). */ sprintf (name, "__%s_EPSILON__", name_prefix); - sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b); + if (fmt->pnan < fmt->p) + /* This is an IBM extended double format, so 1.0 + any double is + representable precisely. */ + sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b); + else + sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b); builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix); /* For C++ std::numeric_limits::denorm_min. The minimum denormalized -- cgit v1.2.1