This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 4407] Fix lgamma sign bug for ldbl-128
- From: "Ryan S. Arnold" <rsa at us dot ibm dot com>
- To: Pete Eberlein <eberlein at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 20 Feb 2008 13:36:53 -0600
- Subject: Re: [PATCH][BZ 4407] Fix lgamma sign bug for ldbl-128
- References: <1202863970.17256.13.camel@eberlein-desktop>
- Reply-to: rsa at us dot ibm dot com
On Tue, 2008-02-12 at 16:52 -0800, Pete Eberlein wrote:
> Regarding Bugzilla 4407:
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=4407
>
> The following patch fixes the case for negative zero in the ldbl-128
> implementation of lgammal. This resolves the make check error for
> ldbl-128 and ldbl-128ibm.
Included is a patch with the full source path for the file in the diff
string.
Ryan S. Arnold
IBM Linux Technology Center
Linux Toolchain Development
2008-02-12 Pete Eberlein <eberlein@us.ibm.com>
[BZ4407]
* sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Preserve sign in
signgamp when x is zero.
--- libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c 2002-08-26 17:40:02.000000000 -0500
+++ libc-patched/sysdeps/ieee754/ldbl-128/e_lgammal_r.c 2008-02-19 10:03:32.000000000 -0600
@@ -772,6 +772,12 @@
if (! __finitel (x))
return x * x;
+ if (x == 0.0L)
+ {
+ if (__signbitl (x))
+ *signgamp = -1;
+ }
+
if (x < 0.0L)
{
q = -x;