This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][BZ #16823] S390: Fix log1pl returning wrong infinity sign
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 10 Apr 2014 08:24:43 +0200
- Subject: Re: [PATCH][BZ #16823] S390: Fix log1pl returning wrong infinity sign
- Authentication-results: sourceware.org; auth=none
- References: <li3hm5$hus$1 at ger dot gmane dot org> <20140409220924 dot GA6638 at domone dot podge>
On 04/10/2014 12:09 AM, OndÅej BÃlka wrote:
On Wed, Apr 09, 2014 at 03:24:21PM +0200, Stefan Liebler wrote:
on S390 test-double fails for log1pl(-1) with infinity has wrong
sign in rounding mode FE_DOWNWARD. See Bug 16823.
In this rounding mode, (x-x) = -0.
In all other rounding modes, (x-x) = +0.
A division with divisor -0 leads to +inf, while +0 results in -inf
as expected. This patch changes the divisor to a const +0.
Tested on s390/s390x.
Is this okay?
Perhaps we could add constants for infinity and nan would to write
return value directly.
Returning a constant of infinity is not enough.
In this case an divide by zero exception should be raised, because
log(0) is not defined.