diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-10 00:20:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-10 00:20:02 +0000 |
commit | 7573452099e010ccf5ac26cb56e0172046671f91 (patch) | |
tree | fd589b00da0c8525b2b62625a4c32dca45dfb3b2 /math.c | |
parent | 6ad7c53ba9fb688ea1070a2319a64f0cc32c08e8 (diff) | |
download | bundler-7573452099e010ccf5ac26cb56e0172046671f91.tar.gz |
math.c (ruby_lgamma_r): reduce duplicate code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -800,11 +800,8 @@ ruby_lgamma_r(const double d, int *sign) { const double g = lgamma_r(d, sign); if (isinf(g)) { - if (d == 0.0 && signbit(d)) { - *sign = -1; - return INFINITY; - } else if (d == 0.0 && !signbit(d)) { - *sign = 1; + if (d == 0.0) { + *sign = signbit(d) ? -1 : +1; return INFINITY; } } |