From edea402804bce917cfd7cd1af76212e6364c23db Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 29 Jun 2014 11:49:08 +0000 Subject: Fix ldbl-128 powl sign of result in overflow / underflow cases (bug 17097). This patch fixes bug 17097, ldbl-128 powl producing overflowing / underflowing results with positive sign when the result should have been negative. This was shown up by the tests in non-default rounding modes added by my patch for bug 16315, but isn't actually limited to non-default rounding modes: rather, when rounding to nearest the wrappers produced a result with the correct sign and so always hid the bug unless -lieee was used to disable the wrappers. The problem is that in the cases where Y is large enough that the result overflows or underflows for X not very close to 1, but not large enough to overflow or underflow for all X != +/- 1 (in the latter case Y is always an even integer), a positive overflowing / underflowing result is always returned, rather than one with the correct sign. This patch moves the relevant part of computation of the sign earlier and returns a result of the correct sign. Tested for mips64. [BZ #17097] * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Return result with correct sign in case of exponents that produce overflow except for X very close to 1. --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 33ce8eded7..070be3c6a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-06-29 Joseph Myers + + [BZ #17097] + * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Return + result with correct sign in case of exponents that produce + overflow except for X very close to 1. + 2014-06-28 Paul Eggert mktime: merge #if/#ifdef usage from glibc -- cgit v1.2.3