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:
parent
6ad7c53ba9
commit
7573452099
1 changed files with 2 additions and 5 deletions
7
math.c
7
math.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue