diff options
Diffstat (limited to 'libm/e_lgamma_r.c')
-rw-r--r-- | libm/e_lgamma_r.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libm/e_lgamma_r.c b/libm/e_lgamma_r.c index 2b1fde78c..23c96d808 100644 --- a/libm/e_lgamma_r.c +++ b/libm/e_lgamma_r.c @@ -208,7 +208,11 @@ double attribute_hidden __ieee754_lgamma_r(double x, int *signgamp) *signgamp = 1; ix = hx&0x7fffffff; if(ix>=0x7ff00000) return x*x; - if((ix|lx)==0) return one/zero; + if((ix|lx)==0) { + if (__signbitl(x)) + *signgamp = -1; + return one/zero; + } if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */ if(hx<0) { *signgamp = -1; |