summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/math.c b/math.c
index 0ce948f8e1..f66f9ff802 100644
--- a/math.c
+++ b/math.c
@@ -786,6 +786,16 @@ math_erfc(VALUE obj, VALUE x)
return DBL2NUM(erfc(Get_Double(x)));
}
+#ifdef __MINGW32__
+static inline double
+mingw_tgamma(const double d)
+{
+ const double g = tgamma(d);
+ return (isnan(g) && !signbit(d)) ? INFINITY : g;
+}
+#define tgamma(d) mingw_tgamma(d)
+#endif
+
/*
* call-seq:
* Math.gamma(x) -> Float