Kaydet (Commit) 50203a69 authored tarafından Mark Dickinson's avatar Mark Dickinson

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

üst 36f27c99
...@@ -239,7 +239,8 @@ m_tgamma(double x) ...@@ -239,7 +239,8 @@ m_tgamma(double x)
} }
if (x == 0.0) { if (x == 0.0) {
errno = EDOM; 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 */ /* integer arguments */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment