This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix strtod rounding of half the least subnormal (bug 16151)
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 13 Nov 2013 11:00:56 +0100
- Subject: Re: Fix strtod rounding of half the least subnormal (bug 16151)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1311111844460 dot 18663 at digraph dot polyomino dot org dot uk>
On Mon, Nov 11, 2013 at 06:45:43PM +0000, Joseph S. Myers wrote:
> This patch fixes bug 16151, incorrect strtod handling of inputs that
> are exactly plus or minus half the least subnormal, for
> round-to-nearest. In this case, the caller of round_and_return
> computes a MANT_DIG-bit mantissa, all of which needs shifting out, and
> the computation of whether any bits were set in that mantissa wrongly
> tests the high-order limb (this limb gets used as round_limb, so the
> relevant subset of bits in it get handled later, so this loop can
> completely ignore it when setting more_bits). This patch makes the
> required adjustment to the loop; the other shift case with such a loop
> is already correct. Tested x86_64 and x86.
>
looks ok