diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 04:13:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 04:13:22 +0000 |
commit | feb1759e482499d5dc2076673c68804704ad7a51 (patch) | |
tree | 9d7473a2a7c53673181ab06e9fcb8071b0a18702 /numeric.c | |
parent | 0ad0d1f34ec9e4acc922c0599e883583e627ac98 (diff) | |
download | ruby-feb1759e482499d5dc2076673c68804704ad7a51.tar.gz |
numeric.c: return true
* numeric.c (num_positive_p): return true instead of Fixnum 0.
[ruby-core:69173] [Feature #11151]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -662,13 +662,13 @@ num_positive_p(VALUE num) if (FIXNUM_P(num)) { if (method_basic_p(rb_cFixnum)) - return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0); + return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0) ? Qtrue : Qfalse; } else if (RB_TYPE_P(num, T_BIGNUM)) { if (method_basic_p(rb_cBignum)) - return BIGNUM_POSITIVE_P(num) && !rb_bigzero_p(num); + return BIGNUM_POSITIVE_P(num) && !rb_bigzero_p(num) ? Qtrue : Qfalse; } - return RTEST(compare_with_zero(num, mid)); + return compare_with_zero(num, mid); } /* |