From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id 7D49B3861034; Fri, 18 Sep 2020 21:20:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D49B3861034 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libm: Make tgamma(-small) = -INFINITY X-Act-Checkin: newlib-cygwin X-Git-Author: Keith Packard X-Git-Refname: refs/heads/master X-Git-Oldrev: 749cbccc55146bdf65a50b71267a16f5bd180334 X-Git-Newrev: 4641693796509d595f8c0521f914faccff77b3ba Message-Id: <20200918212052.7D49B3861034@sourceware.org> Date: Fri, 18 Sep 2020 21:20:52 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 21:20:52 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4641693796509d595f8c0521f914faccff77b3ba commit 4641693796509d595f8c0521f914faccff77b3ba Author: Keith Packard Date: Tue Sep 15 10:10:07 2020 -0700 libm: Make tgamma(-small) = -INFINITY Need to copy the argument sign to the output for tgamma(finite) overflow case. Signed-off-by: Keith Packard Diff: --- newlib/libm/math/k_standard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libm/math/k_standard.c b/newlib/libm/math/k_standard.c index 906412ba7..beab51e16 100644 --- a/newlib/libm/math/k_standard.c +++ b/newlib/libm/math/k_standard.c @@ -331,7 +331,7 @@ static double zero = 0.0; /* used as const */ case 40: case 140: /* gamma(finite) overflow */ - retval = HUGE_VAL; + retval = copysign(HUGE_VAL, x); errno = ERANGE; break; case 41: