mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
numeric.c: raise TypeError at wrong argument
* numeric.c (int_pos_p, int_neg_p): raise TypeError if not an Integer instead of returning nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3f2f64dbeb
commit
04ff7cf712
1 changed files with 2 additions and 2 deletions
|
@ -274,7 +274,7 @@ int_pos_p(VALUE num)
|
|||
else if (RB_TYPE_P(num, T_BIGNUM)) {
|
||||
return BIGNUM_POSITIVE_P(num);
|
||||
}
|
||||
return Qnil;
|
||||
rb_raise(rb_eTypeError, "not an Integer");
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
@ -286,7 +286,7 @@ int_neg_p(VALUE num)
|
|||
else if (RB_TYPE_P(num, T_BIGNUM)) {
|
||||
return BIGNUM_NEGATIVE_P(num);
|
||||
}
|
||||
return Qnil;
|
||||
rb_raise(rb_eTypeError, "not an Integer");
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue