summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2021-09-03 20:50:12 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-11 09:13:24 +0900
commit032534dbdf08c0912dffa482e29a491b8aa9276c (patch)
tree0ef482a3c7d764610ae9e3a0c737fa3133032de7 /rational.c
parent56065f0686e6798fff2ee7319f0f03026f427c13 (diff)
downloadruby-032534dbdf08c0912dffa482e29a491b8aa9276c.tar.gz
Using RB_BIGNUM_TYPE_P macro
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rational.c b/rational.c
index 313dd0892e..b903decaf6 100644
--- a/rational.c
+++ b/rational.c
@@ -199,7 +199,7 @@ f_minus_one_p(VALUE x)
if (RB_INTEGER_TYPE_P(x)) {
return x == LONG2FIX(-1);
}
- else if (RB_TYPE_P(x, T_BIGNUM)) {
+ else if (RB_BIGNUM_TYPE_P(x)) {
return Qfalse;
}
else if (RB_TYPE_P(x, T_RATIONAL)) {
@@ -365,7 +365,7 @@ inline static VALUE
f_gcd(VALUE x, VALUE y)
{
#ifdef USE_GMP
- if (RB_TYPE_P(x, T_BIGNUM) && RB_TYPE_P(y, T_BIGNUM)) {
+ if (RB_BIGNUM_TYPE_P(x) && RB_BIGNUM_TYPE_P(y)) {
size_t xn = BIGNUM_LEN(x);
size_t yn = BIGNUM_LEN(y);
if (GMP_GCD_DIGITS <= xn || GMP_GCD_DIGITS <= yn)
@@ -1034,7 +1034,7 @@ rb_rational_pow(VALUE self, VALUE other)
return f_rational_new2(CLASS_OF(self), num, den);
}
}
- else if (RB_TYPE_P(other, T_BIGNUM)) {
+ else if (RB_BIGNUM_TYPE_P(other)) {
rb_warn("in a**b, b may be too big");
return rb_float_pow(nurat_to_f(self), other);
}