Return +-Py_HUGE_VAL for tgamma(+-0) instead of risking FP exceptions by computing 1.0 / 0.0.

This commit is contained in:
Mark Dickinson 2011-09-25 15:26:43 +01:00
parent 36f27c995a
commit 50203a69b3
1 changed files with 2 additions and 1 deletions

View File

@ -239,7 +239,8 @@ m_tgamma(double x)
}
if (x == 0.0) {
errno = EDOM;
return 1.0/x; /* tgamma(+-0.0) = +-inf, divide-by-zero */
/* tgamma(+-0.0) = +-inf, divide-by-zero */
return copysign(Py_HUGE_VAL, x);
}
/* integer arguments */