diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-03 12:55:27 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-03 12:55:27 +0000 |
commit | f167780b24a2bbdaaa6506de43206e55ce360ee2 (patch) | |
tree | c74f626a2179740f3901eae226591e3152dbea0f /rational.c | |
parent | 633de83b7647fa8ceafe41d54e0802a37d990458 (diff) | |
download | ruby-f167780b24a2bbdaaa6506de43206e55ce360ee2.tar.gz ruby-f167780b24a2bbdaaa6506de43206e55ce360ee2.tar.xz ruby-f167780b24a2bbdaaa6506de43206e55ce360ee2.zip |
* complex.c (nucomp_int_check): function for DRY real check.
* complex.c (nucomp_{add,sub,mul,div,expt}): use rb_num_coerce_bin().
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rational.c b/rational.c index 841a017bc..fe7ec37b8 100644 --- a/rational.c +++ b/rational.c @@ -425,7 +425,7 @@ f_rational_new_bang2(VALUE klass, VALUE x, VALUE y) #define f_unify_p(klass) rb_const_defined(klass, id_Unify) -static inline void +inline static void nurat_int_check(VALUE num) { switch (TYPE(num)) { @@ -880,7 +880,7 @@ nurat_expt(VALUE self, VALUE other) case T_RATIONAL: return f_expt(f_to_f(self), other); default: - return rb_num_coerce_bin(self, other, rb_intern("**")); + return rb_num_coerce_bin(self, other, id_expt); } } @@ -917,7 +917,7 @@ nurat_cmp(VALUE self, VALUE other) return f_cmp(f_sub(num1, num2), ZERO); } default: - return rb_num_coerce_bin(self, other, rb_intern("<=>")); + return rb_num_coerce_bin(self, other, id_cmp); } } |