summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 21:17:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 21:17:34 +0000
commit3c99764bcdd181cbac849f82e512f4b64bdf27c1 (patch)
tree6947c6d745b014a192c645a2652a84c46718d421 /numeric.c
parent7f27543b3b1dfbd864c7e4edd22f739078fd2908 (diff)
* internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS. (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX. (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT. (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN. (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN. (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P. (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P. (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG. (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK. (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT. (BIGNUM_LEN): Renamed from RBIGNUM_LEN. (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS. (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT. * bignum.c: Follow the above change. * gc.c: Ditto. * marshal.c: Ditto. * math.c: Ditto. * numeric.c: Ditto. * random.c: Ditto. * rational.c: Ditto. * sprintf.c: Ditto. * ext/-test-/bignum/bigzero.c: Ditto. * ext/-test-/bignum/intpack.c: Ditto. * ext/bigdecimal/bigdecimal.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/numeric.c b/numeric.c
index 4bb2c3a534..838ec43c29 100644
--- a/numeric.c
+++ b/numeric.c
@@ -145,7 +145,7 @@ rb_num_to_uint(VALUE val, unsigned int *ret)
}
if (RB_TYPE_P(val, T_BIGNUM)) {
- if (RBIGNUM_NEGATIVE_P(val)) return NUMERR_NEGATIVE;
+ if (BIGNUM_NEGATIVE_P(val)) return NUMERR_NEGATIVE;
#if SIZEOF_INT < SIZEOF_LONG
/* long is 64bit */
return NUMERR_TOOLARGE;
@@ -172,7 +172,7 @@ positive_int_p(VALUE num)
}
else if (RB_TYPE_P(num, T_BIGNUM)) {
if (method_basic_p(rb_cBignum))
- return RBIGNUM_POSITIVE_P(num);
+ return BIGNUM_POSITIVE_P(num);
}
return RTEST(rb_funcall(num, mid, 1, INT2FIX(0)));
}
@@ -188,7 +188,7 @@ negative_int_p(VALUE num)
}
else if (RB_TYPE_P(num, T_BIGNUM)) {
if (method_basic_p(rb_cBignum))
- return RBIGNUM_NEGATIVE_P(num);
+ return BIGNUM_NEGATIVE_P(num);
}
return RTEST(rb_funcall(num, mid, 1, INT2FIX(0)));
}
@@ -2066,7 +2066,7 @@ rb_num2ulong_internal(VALUE val, int *wrap_p)
{
unsigned long ul = rb_big2ulong(val);
if (wrap_p)
- *wrap_p = RBIGNUM_NEGATIVE_P(val);
+ *wrap_p = BIGNUM_NEGATIVE_P(val);
return ul;
}
}
@@ -3434,7 +3434,7 @@ fix_aref(VALUE fix, VALUE idx)
if (!FIXNUM_P(idx)) {
idx = rb_big_norm(idx);
if (!FIXNUM_P(idx)) {
- if (!RBIGNUM_SIGN(idx) || val >= 0)
+ if (!BIGNUM_SIGN(idx) || val >= 0)
return INT2FIX(0);
return INT2FIX(1);
}