diff options
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -750,7 +750,7 @@ ruby_tgamma(const double d) #define tgamma(d) ruby_tgamma(d) #endif -#if defined LGAMMA_R_M0_FIX +#if defined LGAMMA_R_PM0_FIX static inline double ruby_lgamma_r(const double d, int *sign) { @@ -759,6 +759,9 @@ ruby_lgamma_r(const double d, int *sign) if (d == 0.0 && signbit(d)) { *sign = -1; return INFINITY; + } else if (d == 0.0 && !signbit(d)) { + *sign = 1; + return INFINITY; } } return g; |