|
Message-ID: <20120410121515.GU5728@port70.net> Date: Tue, 10 Apr 2012 14:15:15 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: float scanner status, upcoming release * Rich Felker <dalias@...ifal.cx> [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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.