about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/e_lgamma_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/e_lgamma_r.c')
-rw-r--r--sysdeps/ieee754/dbl-64/e_lgamma_r.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index cc44b048f4..a298a5a2a4 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -228,7 +228,12 @@ static double zero=  0.00000000000000000000e+00;
 	*signgamp = 1;
 	ix = hx&0x7fffffff;
 	if(ix>=0x7ff00000) return x*x;
-	if((ix|lx)==0) return one/fabs(x);
+	if((ix|lx)==0)
+	  {
+	    if (hx < 0)
+	      *signgamp = -1;
+	    return one/fabs(x);
+	  }
 	if(ix<0x3b900000) {	/* |x|<2**-70, return -log(|x|) */
 	    if(hx<0) {
 	        *signgamp = -1;