summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/math.c b/math.c
index 5e2cbe9b74..7be5115b7e 100644
--- a/math.c
+++ b/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;
}
}