lib/libm/wf_tgamma: Fix tgammaf handling of -inf, should return nan.

This commit is contained in:
Damien George 2018-09-04 17:00:35 +10:00
parent afc7ddca31
commit b9a133e5ad
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@
{
float y;
int local_signgam;
if (!isfinite(x)) {
/* special cases: tgammaf(nan)=nan, tgammaf(inf)=inf, tgammaf(-inf)=nan */
return x + INFINITY;
}
y = expf(__ieee754_lgammaf_r(x,&local_signgam));
if (local_signgam < 0) y = -y;
#ifdef _IEEE_LIBM