From owner-freebsd-standards@FreeBSD.ORG Wed May 7 16:06:32 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7613737B401; Wed, 7 May 2003 16:06:32 -0700 (PDT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEB2B43F93; Wed, 7 May 2003 16:06:29 -0700 (PDT) (envelope-from sean@perrin.int.nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id 3BA8C20F00; Wed, 7 May 2003 16:06:28 -0700 (PDT) Date: Wed, 7 May 2003 16:06:28 -0700 From: Sean Chittenden To: Bruce Evans Message-ID: <20030507230627.GQ49916@perrin.int.nxad.com> References: <20030507175740.GM49916@perrin.int.nxad.com> <20030508080005.D4073@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="//IivP0gvsAy3Can" Content-Disposition: inline In-Reply-To: <20030508080005.D4073@gamplex.bde.org> User-Agent: Mutt/1.4i X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ cc: das@freebsd.org cc: freebsd-standards@freebsd.org Subject: Re: float values at the extreme... when did things change? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2003 23:06:32 -0000 --//IivP0gvsAy3Can Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > Small values were considered zero. Now, however, small values are out > > of range: > > > > INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); > > ERROR: Input '-10e400' is out of range for float8 > > INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); > > ERROR: Input '10e-400' is out of range for float8 > > INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); > > ERROR: Input '-10e-400' is out of range for float8 > > > > No doubt that things are more correct in their current > > incarnation, however, when did this change (not sure where to > > look) and was there a __FreeBSD_version bump regarding this? -sc >=20 > Some LDBL_* constants, especially ones related to small values, were > broken in rev.1.7 of the i386 , but this problem seems to > be just a bug in the regression tests combined with a change in the > implementation-defined behaviour of strtod(). >=20 > strtod("10e-400", NULL) now sets errno to ERANGE. It apparently now > detects underflow when it didn't before, or decides to report this > by setting errno to ERANGE when it didn't before. Whether errno is > set to ERANGE on underflow is implementation-defined, so it is a bug > in the regression tests for them to not expect this error. Whether > it is actually an error depends on whether the application cares > about underflow. >=20 > gdtoa has a knob for changing this behaviour (see the README), but > this should never be used since it breaks the standard behaviour of > setting errno to ERANGE on overflow in strtod(). >=20 > In RELENG_4, strtod() attempts to set errno to ERANGE on underflow. > It has no knob to control this, but its underflow detection is > broken unless the library is compiled with -O0. This might be a > compiler bug (mishandling of extra precision could easily break > underflow checks). Hrm, considering Peter's recent post regarding gdtoa, can I count on this to continue to work even if gdtoa gets ripped out or isn't in use on a system (isn't gdtoa GPL-ware? Why'd we even bother importing it anyway)? How about the base system's old version of strtod, will it be fixed at some point for higher optimization levels? -sc --=20 Sean Chittenden --//IivP0gvsAy3Can Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden iD8DBQE+uZFz3ZnjH7yEs0ERAhYTAJwO0FoJop3ZFQ2rCihtxJ1Rq+y8wwCfSECQ kq66ezDG085B72ua6SlX3qU= =da1L -----END PGP SIGNATURE----- --//IivP0gvsAy3Can--