summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/rational.c b/rational.c
index 40b480df6e..3af98c76c5 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) || TYPE(x) == T_BIGNUM)
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
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) || TYPE(y) == T_BIGNUM)
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
return ZERO;
}
else if (ix == 1)
@@ -141,14 +141,14 @@ fun1(negate)
inline static VALUE
f_to_i(VALUE x)
{
- if (TYPE(x) == T_STRING)
+ if (RB_TYPE_P(x, T_STRING))
return rb_str_to_inum(x, 10, 0);
return rb_funcall(x, id_to_i, 0);
}
inline static VALUE
f_to_f(VALUE x)
{
- if (TYPE(x) == T_STRING)
+ if (RB_TYPE_P(x, T_STRING))
return DBL2NUM(rb_str_to_dbl(x, 0));
return rb_funcall(x, id_to_f, 0);
}
@@ -2161,7 +2161,7 @@ string_to_r(VALUE self)
a1 = RARRAY_PTR(a)[0];
if (!NIL_P(a1)) {
- if (TYPE(a1) == T_FLOAT)
+ if (RB_TYPE_P(a1, T_FLOAT))
rb_raise(rb_eFloatDomainError, "Infinity");
return a1;
}