From owner-freebsd-standards@FreeBSD.ORG Fri Jan 9 17:07:46 2009 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A961065673; Fri, 9 Jan 2009 17:07:46 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (mx2.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA658FC19; Fri, 9 Jan 2009 17:07:46 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id n09GZlO6096184; Fri, 9 Jan 2009 09:35:48 -0700 (MST) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.3/8.14.3) with ESMTP id n09FvWJF086273; Fri, 9 Jan 2009 08:57:32 -0700 (MST) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.3/8.14.3/Submit) id n09FvQCB086267; Fri, 9 Jan 2009 08:57:26 -0700 (MST) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <18791.29670.321788.799095@gromit.timing.com> Date: Fri, 9 Jan 2009 08:57:26 -0700 From: John Hein To: =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= In-Reply-To: <496676AB.9040905@sh.cvut.cz> References: <200812302231.mBUMVUtf092910@www.freebsd.org> <20081231215445.S3923@delplex.bde.org> <20090106190313.GA15233@zim.MIT.EDU> <496676AB.9040905@sh.cvut.cz> X-Mailer: VM 7.19 under Emacs 22.3.1 X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on Daffy.timing.com X-Virus-Status: Clean Cc: freebsd-standards@FreeBSD.ORG, das@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG, imp@FreeBSD.ORG Subject: Re: standards/130067: Wrong numeric limits in system headers? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2009 17:07:47 -0000 V=E1clav Haisman wrote at 22:56 +0100 on Jan 8, 2009: > David Schultz wrote, On 6.1.2009 20:03: > > On FreeBSD/i386, long doubles are represented with 64 bits of > > precision, but computations are performed with 53 bits of > > precision. In a sane world, this discrepancy wouldn't exist, but > > for reasons I won't get into, they do, and probably always will. > > = > > C99 defines the LDBL constants based on what can be represented, > > not what can be computed as the result of arithmetic operations, > > so my interpretation is that the values in float.h are correct, > > though confusing. > I am not language lawyer but even if it were true that the constants a= re > right, there is still the problem that they (especially the LDBL_MAX v= alue) > are useless with the provided GCC. Either GCC or the headers should be= > changed. Otherwise the constants are rather useless and unusable. FWIW, when you compile the OP's sample code on i386 with -pedantic (with 6.x's base gcc 3.4.6 or 7.x's base gcc 4.2.1), you get: x.cc:11: error: floating constant exceeds range of 'long double' (the LDBL_MAX line) That seems to tip the scale more to the 'float.h is wrong' side.