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
This commit is contained in:
parent
b4e5bff89d
commit
59b089bd09
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user