public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Johnston <jjohnstn@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] libm: Make tgamma(-small) = -INFINITY
Date: Fri, 18 Sep 2020 21:20:52 +0000 (GMT)	[thread overview]
Message-ID: <20200918212052.7D49B3861034@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4641693796509d595f8c0521f914faccff77b3ba

commit 4641693796509d595f8c0521f914faccff77b3ba
Author: Keith Packard <keithp@keithp.com>
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 <keithp@keithp.com>

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:


                 reply	other threads:[~2020-09-18 21:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200918212052.7D49B3861034@sourceware.org \
    --to=jjohnstn@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).