summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 (GMT)
commit4a9705d6e3384342a3ee649bfdbd93062140b5fd (patch)
treeadf65284cfe148dee36c8d8def3739543dcdf37a /rational.c
parentabe32a00b1096c0be8196385cccb983ca2b5e497 (diff)
ruby.h: RB_INTEGER_TYPE_P
* include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and underlying inline function to check if the object is an Integer (Fixnum or Bignum). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rational.c b/rational.c
index f4b34da..1909536 100644
--- a/rational.c
+++ b/rational.c
@@ -106,7 +106,7 @@ f_mul(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
long iy = FIX2LONG(y);
if (iy == 0) {
- if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
+ if (RB_INTEGER_TYPE_P(x))
return ZERO;
}
else if (iy == 1)
@@ -115,7 +115,7 @@ f_mul(VALUE x, VALUE y)
else if (FIXNUM_P(x)) {
long ix = FIX2LONG(x);
if (ix == 0) {
- if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
+ if (RB_INTEGER_TYPE_P(y))
return ZERO;
}
else if (ix == 1)