aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-01 12:35:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-01 12:35:32 +0000
commitdf5c57f2ceb8df6c1956677cd9f8272b16771ad7 (patch)
treee499c95c66a956a781e00a7c3ac009a881d3730c /numeric.c
parent11df2c25be42614108b16a4ec9147aba9da91e21 (diff)
downloadruby-df5c57f2ceb8df6c1956677cd9f8272b16771ad7.tar.gz
numeric.c: fix return value on big 0
* numeric.c (num_zero_p): should return true if zero. rb_bigzero_p returns 1 or 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 21e8eeeb8e..9a9b8d0b44 100644
--- a/numeric.c
+++ b/numeric.c
@@ -721,7 +721,10 @@ num_zero_p(VALUE num)
}
}
else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_bigzero_p(num);
+ if (rb_bigzero_p(num)) {
+ /* this should not happen usually */
+ return Qtrue;
+ }
}
else if (rb_equal(num, INT2FIX(0))) {
return Qtrue;