mirror of https://github.com/python/cpython
Return +-Py_HUGE_VAL for tgamma(+-0) instead of risking FP exceptions by computing 1.0 / 0.0.
This commit is contained in:
parent
36f27c995a
commit
50203a69b3
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue