summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-25 07:27:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-25 07:27:07 +0000
commit573222510251c3778d6b0c382daa6de8416bc095 (patch)
treeca7173d630a0fb699b853492354455a2ca0b73ef /bignum.c
parent4dcad25b23a294cda132a732e53a5bcd640c6a0f (diff)
bignum.c: use predefined IDs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bignum.c b/bignum.c
index 0ef5faf6bf..99dbfc148a 100644
--- a/bignum.c
+++ b/bignum.c
@@ -12,6 +12,7 @@
#include "internal.h"
#include "ruby/thread.h"
#include "ruby/util.h"
+#include "id.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -5364,7 +5365,7 @@ rb_big_cmp(VALUE x, VALUE y)
return rb_integer_float_cmp(x, y);
}
else {
- return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
+ return rb_num_coerce_cmp(x, y, idCmp);
}
return INT2FIX(BIGNUM_SIGN(x) ? 1 : -1);
}
@@ -5392,9 +5393,9 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
ID id = 0;
switch (op) {
case big_op_gt: id = '>'; break;
- case big_op_ge: id = rb_intern(">="); break;
+ case big_op_ge: id = idGE; break;
case big_op_lt: id = '<'; break;
- case big_op_le: id = rb_intern("<="); break;
+ case big_op_le: id = idLE; break;
}
return rb_num_coerce_relop(x, y, id);
}
@@ -6174,7 +6175,7 @@ rb_big_pow(VALUE x, VALUE y)
if (RB_FLOAT_TYPE_P(y)) {
d = RFLOAT_VALUE(y);
if ((BIGNUM_NEGATIVE_P(x) && !BIGZEROP(x)) && d != round(d))
- return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
+ return rb_funcall(rb_complex_raw1(x), idPow, 1, y);
}
else if (RB_BIGNUM_TYPE_P(y)) {
y = bignorm(y);
@@ -6187,7 +6188,7 @@ rb_big_pow(VALUE x, VALUE y)
yy = FIX2LONG(y);
if (yy < 0)
- return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
+ return rb_funcall(rb_rational_raw1(x), idPow, 1, y);
else {
VALUE z = 0;
SIGNED_VALUE mask;
@@ -6212,7 +6213,7 @@ rb_big_pow(VALUE x, VALUE y)
}
}
else {
- return rb_num_coerce_bin(x, y, rb_intern("**"));
+ return rb_num_coerce_bin(x, y, idPow);
}
return DBL2NUM(pow(rb_big2dbl(x), d));
}