From f382031d34cdcbaaa9a5f2fd17296574095b85ad Mon Sep 17 00:00:00 2001 From: Steve Kargl Date: Wed, 17 Sep 2014 19:01:22 +0000 Subject: For targets that have a signed zero, lgamma_r(-0, &signgamp) should set signgamp = -1. Submitted by: enh at google dot com (e_lgamma[f]_r.c) --- lib/msun/ld128/e_lgammal_r.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/msun/ld128') diff --git a/lib/msun/ld128/e_lgammal_r.c b/lib/msun/ld128/e_lgammal_r.c index a612681d3d7d..13f8f75a46c6 100644 --- a/lib/msun/ld128/e_lgammal_r.c +++ b/lib/msun/ld128/e_lgammal_r.c @@ -241,7 +241,11 @@ lgammal_r(long double x, int *signgamp) *signgamp = 1; if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */ return x*x; - if((hx==0||hx==0x8000)&&lx==0) return one/vzero; + if((hx==0||hx==0x8000)&&lx==0) { + if (hx&0x8000) + *signgamp = -1; + return one/vzero; + } /* purge off tiny and negative arguments */ if(fabsl(x)<0x1p-119L) { -- cgit v1.2.3