public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] libm: Make tgamma(-small) = -INFINITY
@ 2020-09-18 21:20 Jeff Johnston
  0 siblings, 0 replies; only message in thread
From: Jeff Johnston @ 2020-09-18 21:20 UTC (permalink / raw)
  To: newlib-cvs

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:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-18 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 21:20 [newlib-cygwin] libm: Make tgamma(-small) = -INFINITY Jeff Johnston

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).