1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2017-05-10 00:20:02 +00:00
parent 6ad7c53ba9
commit 7573452099

7
math.c
View file

@ -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;
}
}