From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/700 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: float scanner status, upcoming release Date: Tue, 10 Apr 2012 14:15:15 +0200 Message-ID: <20120410121515.GU5728@port70.net> References: <20120409191712.GA5269@brightrain.aerifal.cx> <20120410004819.GB7281@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1334060129 5817 80.91.229.3 (10 Apr 2012 12:15:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2012 12:15:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-701-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 10 14:15:28 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SHZyq-00040b-GR for gllmg-musl@plane.gmane.org; Tue, 10 Apr 2012 14:15:28 +0200 Original-Received: (qmail 18139 invoked by uid 550); 10 Apr 2012 12:15:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18131 invoked from network); 10 Apr 2012 12:15:27 -0000 Content-Disposition: inline In-Reply-To: <20120410004819.GB7281@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:700 Archived-At: * Rich Felker [2012-04-09 20:48:19 -0400]: > Revised version of the code, in preparation to integrate with musl. > Still needs hex float support, and I want to eliminate the fscanf > dependency. Comments welcome. > this one fails if the number starts with a . ./floatscan .3 large exponent is slow: ./floatscan 1e+1000000 ./floatscan 1e-1000000 subnormal tests still fail here are some test cases where many digits are needed for correct rounding: long double (ld80, min subnormal is 2^-16445, min normal is 2^-16382): // 2^-16445 * 0.5 - eps (should be rounded to 0) .1822599765941237301264202966809709908199525407846781671860490243514185844316698e-4950 // 2^-16445 * 0.5 + eps (should be rounded to 0x1p-16445L) .1822599765941237301264202966809709908199525407846781671860490243514185844316699e-4950 // 2^-16445 * 1.5 - eps (should be rounded to 0x1p-16445L) .5467799297823711903792608900429129724598576223540345015581470730542557532950096e-4950 // 2^-16445 * 1.5 + eps (should be rounded to 0x1p-16444L) .5467799297823711903792608900429129724598576223540345015581470730542557532950097e-4950 // 2^-16382 + 2^-16446 - eps (should be rounded to 0x1p-16382L) .3362103143112093506444937793915876332724499641527442230928779770593420866576777e-4931 // 2^-16382 + 2^-16446 + eps (should be rounded to 0x1.0000000000000002p-16382) .3362103143112093506444937793915876332724499641527442230928779770593420866576778e-4931 double (min subnormal is 2^-1074, min normal is 2^-1022): // 2^-1074 * 0.5 - eps .2470328229206232720882843964341106861825299013071623822127928412503377536351043e-323 // 2^-1074 * 0.5 + epsA .2470328229206232720882843964341106861825299013071623822127928412503377536351044e-323 // 2^-1074 * 1.5 - eps .7410984687618698162648531893023320585475897039214871466383785237510132609053131e-323 // 2^-1074 * 1.5 + eps .7410984687618698162648531893023320585475897039214871466383785237510132609053132e-323 // 2^-1022 + 2^-1075 - eps .2225073858507201630123055637955676152503612414573018013083228724049586647606759e-307 // 2^-1022 + 2^-1075 + eps .2225073858507201630123055637955676152503612414573018013083228724049586647606760e-307 float (min subnormal is 2^-149, min normal is 2^-126): // 2^-149 * 0.5 - eps .7006492321624085354618647916449580656401309709382578858785341419448955413429303e-45 // 2^-149 * 0.5 + eps .7006492321624085354618647916449580656401309709382578858785341419448955413429304e-45 // 2^-149 * 0.5 - eps .2101947696487225606385594374934874196920392912814773657635602425834686624028790e-44 // 2^-149 * 0.5 + eps .2101947696487225606385594374934874196920392912814773657635602425834686624028791e-44 // 2^-126 + 2^-150 - eps .1175494420887210724209590083408724842314472120785184615334540294131831453944281e-37 // 2^-126 + 2^-150 + eps .1175494420887210724209590083408724842314472120785184615334540294131831453944282e-37