diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 07:33:18 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 07:33:18 +0000 |
commit | 4eba34451749f684aeb9df41acacc0475b0b071e (patch) | |
tree | a0e150a608a054a2e7bbc4f572ca528aad165b96 /missing | |
parent | e102f56340d50a2459312df876eb3010cc4b92ef (diff) |
merge revision(s) 49913,54492,54494,54495,54496,54499,54503: [Backport #12249]
math.c: fix tgamma on mingw
* math.c (mingw_tgamma): tgamma(3) on mingw returns a NaN for a
big number, not infinity.
* math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
[ruby-core:74817] [Bug #12249]
* math.c (ruby_lgamma_r): fix lgamma(-0.0) on mingw and OSX.
* math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
cf. [Bug #12249]
* math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
since msvcrt does not provide it.
* missing/lgamma_r.c (lgamma_r): fix lgamma(-0.0).
[ruby-core:74823] [Bug #12249]
* configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)
returns negative infinity. [Bug #12249]
* math.c (ruby_lgamma_r): define by the configured result.
* configure.in (rb_cv_lgamma_r_m0): fix the condition for
lgamma_r(-0.0). [Bug #12249]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r-- | missing/lgamma_r.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c index 6d2f38f40c..01066d2930 100644 --- a/missing/lgamma_r.c +++ b/missing/lgamma_r.c @@ -66,7 +66,7 @@ lgamma_r(double x, int *signp) double i, f, s; f = modf(-x, &i); if (f == 0.0) { /* pole error */ - *signp = 1; + *signp = signbit(x) ? -1 : 1; errno = ERANGE; return HUGE_VAL; } |