diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-07 19:04:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-07 19:04:18 +0000 |
commit | c26293dccfd1ed1388980957c0dd65bdb9c68a01 (patch) | |
tree | ef014f1bc38e57194eeb3d26546614c074e9b946 /math.c | |
parent | a77ae1eced469384d8d17047c7fa15e64675de07 (diff) | |
download | ruby-c26293dccfd1ed1388980957c0dd65bdb9c68a01.tar.gz |
bignum.c, math.c: type predicates
* bignum.c, math.c: use type predicate macros instead of TYPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -444,7 +444,7 @@ math_log(int argc, VALUE *argv) rb_scan_args(argc, argv, "11", &x, &base); - if (TYPE(x) == T_BIGNUM && RBIGNUM_POSITIVE_P(x) && + if (RB_TYPE_P(x, T_BIGNUM) && RBIGNUM_POSITIVE_P(x) && DBL_MAX_EXP <= (numbits = rb_absint_numwords(x, 1, NULL))) { numbits -= DBL_MANT_DIG; x = rb_big_rshift(x, SIZET2NUM(numbits)); @@ -501,7 +501,7 @@ math_log2(VALUE obj, VALUE x) double d0, d; size_t numbits = 0; - if (TYPE(x) == T_BIGNUM && RBIGNUM_POSITIVE_P(x) && + if (RB_TYPE_P(x, T_BIGNUM) && RBIGNUM_POSITIVE_P(x) && DBL_MAX_EXP <= (numbits = rb_absint_numwords(x, 1, NULL))) { numbits -= DBL_MANT_DIG; x = rb_big_rshift(x, SIZET2NUM(numbits)); @@ -540,7 +540,7 @@ math_log10(VALUE obj, VALUE x) double d0, d; size_t numbits = 0; - if (TYPE(x) == T_BIGNUM && RBIGNUM_POSITIVE_P(x) && + if (RB_TYPE_P(x, T_BIGNUM) && RBIGNUM_POSITIVE_P(x) && DBL_MAX_EXP <= (numbits = rb_absint_numwords(x, 1, NULL))) { numbits -= DBL_MANT_DIG; x = rb_big_rshift(x, SIZET2NUM(numbits)); |