To: djgpp AT sun DOT soe DOT clarkson DOT edu Cc: cjd AT brb DOT dmt DOT csiro DOT au Subject: Re: Bug in floating point constants Date: Thu, 08 Apr 93 12:26:39 +1000 From: Cameron Davidson Richard Stallman's reply: > Is there any reason to think this bug is in GCC? > I would expect it is in the C library that you are using. > However, you are in luck: the next version of GCC will > come with its own floating point conversion code, which > ought to be fully accurate. Yes: atof, strtod and scanf all give the same problem. It is a bit messier than I noted before: as the exponent increases, an increasing number of the least significant bits of the mantissa are not set reliably. By the time the exponent is around 270-300 (decimal) 4 bits are unreliable. 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