diff options
author | Keith Packard <keithp@keithp.com> | 2020-09-15 10:10:07 -0700 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2020-09-18 17:20:27 -0400 |
commit | 4641693796509d595f8c0521f914faccff77b3ba (patch) | |
tree | ebefcee122b7148533f6840d92d83f35acc74caa /newlib/libm | |
parent | 749cbccc55146bdf65a50b71267a16f5bd180334 (diff) | |
download | newlib-4641693796509d595f8c0521f914faccff77b3ba.zip newlib-4641693796509d595f8c0521f914faccff77b3ba.tar.gz newlib-4641693796509d595f8c0521f914faccff77b3ba.tar.bz2 |
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>
Diffstat (limited to 'newlib/libm')
-rw-r--r-- | newlib/libm/math/k_standard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libm/math/k_standard.c b/newlib/libm/math/k_standard.c index 906412b..beab51e 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: |