Article View: gnu.gcc.bug
Article #6063Re: float.h
From: J.T. Conklin
Date: Thu, 12 Dec 1996 00:00
Date: Thu, 12 Dec 1996 00:00
32 lines
1537 bytes
1537 bytes
> While there may be other problems, I find 2 errors in <float.h> supplied > with my copy of gcc. FLT_DIG is reported as 6 where 7 is correct. You don't give what CPU type your machine is, so I'll assume it uses IEEE754 single precision for floats. If this is true, 6 is the correct value. The number of decimal digits is computed as follows: floor( (p-1) x log10 b) + (b == power of 10) = floor((24-1) x log10 2) + 0 = floor(23 x 0.301030...) = floor(6.923690...) = 6 IEEE singles have almost but not quite 7 decimal digits of precision. > This goes way back to the original proposal, so it may be hard to > get it changed in the distribution. DBL_MAX is given to only 16 > digits, where 17 are required to obtain the correct binary value. > The correct value is 1.7976931348623157e308. The value rounded of > to 16 digits compiles to Infinity and that is not the fault of the > compiler! Don't know about this one --- it's correct in my gcc installation. --jtc
Technical Details
Message-ID:
<199612130316.TAA27975@rhino.cygnus.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<19961213022000.VAA24581.cygnus.bug-gcc@ladder01.news.aol.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,ce373ce11c1bb63d,start X-Google-Attributes: gid113d02,public From: "J.T. Conklin" <jtc@rhino.cygnus.com> Subject: Re: float.h Date: 1996/12/12 Message-ID: <199612130316.TAA27975@rhino.cygnus.com> X-Deja-AN: 203829472 sender: bug-gcc-request@prep.ai.mit.edu references: <19961213022000.VAA24581.cygnus.bug-gcc@ladder01.news.aol.com> x-gateway: relay3.UU.NET from bug-gcc to gnu.gcc.bug; Thu, 12 Dec 1996 22:16:46 EST newsgroups: gnu.gcc.bug