This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix pow overflow in non-default rounding modes (bug 16315)
- From: Andreas Jaeger <aj at suse dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Mon, 23 Jun 2014 20:23:12 +0200
- Subject: Re: Fix pow overflow in non-default rounding modes (bug 16315)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1406041749420 dot 3719 at digraph dot polyomino dot org dot uk>
On 06/04/2014 07:50 PM, Joseph S. Myers wrote:
> This patch, relative to a tree with
> <https://sourceware.org/ml/libc-alpha/2014-06/msg00076.html> applied,
> fixes bug 16315, bad pow handling of overflow/underflow in non-default
> rounding modes. Tests of pow are duly converted to ALL_RM_TEST to run
> all tests in all rounding modes.
>
> There are two main issues here. First, various implementations
> compute a negative result by negating a positive result, but this
> yields inappropriate overflow / underflow values for directed
> rounding, so either overflow / underflow results need recomputing in
> the correct sign, or the relevant overflowing / underflowing operation
> needs to be made to have a result of the correct sign. Second, the
> dbl-64 implementation sets FE_TONEAREST internally; in the overflow /
> underflow case, the result needs recomputing in the original rounding
> mode.
>
> Tested x86_64 and x86 and ulps updated accordingly.
Thanks, looks fine,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126