mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: float scanner status, upcoming release
Date: Tue, 10 Apr 2012 14:15:15 +0200	[thread overview]
Message-ID: <20120410121515.GU5728@port70.net> (raw)
In-Reply-To: <20120410004819.GB7281@brightrain.aerifal.cx>

* Rich Felker <dalias@aerifal.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


  reply	other threads:[~2012-04-10 12:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 19:17 Rich Felker
2012-04-09 19:21 ` Rich Felker
2012-04-10  0:09   ` Pascal Cuoq
2012-04-10  0:36     ` Rich Felker
2012-04-10  0:48 ` Rich Felker
2012-04-10 12:15   ` Szabolcs Nagy [this message]
2012-04-10 13:02     ` Rich Felker
2012-04-10 15:24 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120410121515.GU5728@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).