diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-06 01:17:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-06 01:17:55 +0000 |
commit | b79867b1014acd84e2fed42e550c90f9f5c3c36b (patch) | |
tree | 12ca9bb4ca84999c676c44799b495825bf9f35c9 /missing | |
parent | e3991677c1b3c266a32044fefdade00ef7aae1d3 (diff) | |
download | ruby-b79867b1014acd84e2fed42e550c90f9f5c3c36b.tar.gz |
lgamma_r.c: fix at -0.0
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54496 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; } |