4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-02 04:20:28 +08:00

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>
This commit is contained in:
Keith Packard 2020-09-15 10:10:07 -07:00 committed by Ken Brown
parent b7c1137941
commit 2bd71cbf91

View File

@ -331,7 +331,7 @@ static double zero = 0.0; /* used as const */
case 40: case 40:
case 140: case 140:
/* gamma(finite) overflow */ /* gamma(finite) overflow */
retval = HUGE_VAL; retval = copysign(HUGE_VAL, x);
errno = ERANGE; errno = ERANGE;
break; break;
case 41: case 41: