To: graeme AT labtam DOT labtam DOT oz DOT au (Graeme Gill) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu, cjd AT brb DOT dmt DOT csiro DOT au Subject: Re: Bug in floating point constants Date: Wed, 07 Apr 93 13:39:10 +1000 From: Cameron Davidson Here is the problem reduced somewhat: *************** double d[] = { 1.0e67, 1.0e68, 1.0e69, 1.0e70, 1.0e71 }; *************** gcc -S produces the following asm file:: .file "dbltest.c" gcc2_compiled.: .globl _d .data .align 2 _d: .double 0d1.00000000000000000000e+67 .double 0d1.00000000000000000000e+68 .double 0d1.00000000000000070000e+69 .double 0d1.00000000000000070000e+70 .double 0d1.00000000000000070000e+71 ***************** ANY number above approx 1e68 is incorrectly converted by one of the pre-assembly passes of gcc 2.2.2. The number produced is too big by a value equal to the two least significant bits of the mantissa. They are not ORed in but added in, hence MAX_DBL overflows. I seem to recall that some users have GCC 2.3.3 running under GO32. Could somebody try to see if the bug is still present in that version? Cameron Davidson, CSIRO Division of Manufacturing Technology, Telephone: +61 7 212 4535 Qld Centre for Advanced Technologies, Facsimile: +61 7 212 4681 2643 Moggill Rd, Pinjarra Hills, Qld, 4069. Internet: cjd AT brb DOT dmt DOT csiro DOT au