summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/mathmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index cebb4ff..7e73bfe 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -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 */