diff options
author | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-27 20:00:57 +0000 |
---|---|---|
committer | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-27 20:00:57 +0000 |
commit | 7a3f794da0fbfacb99c0721271990d39c9885928 (patch) | |
tree | 3962f58746db2f87245b19e067bcb307ac563b4d /math.c | |
parent | 173005bb6fa9c4b2f54633313f4ff352348a3eeb (diff) | |
download | ruby-7a3f794da0fbfacb99c0721271990d39c9885928.tar.gz |
* configure.in (rb_cv_lgamma_r_pm0): check if lgamma_r(+0.0)
returns positive infinity, in addition to lgamma_r(-0.0).
AIX returns an incorrect result of negative infinity.
* math.c (ruby_lgamma_r): handle +0.0, in addition to -0.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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; |