summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 12:55:27 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 12:55:27 +0000
commit5d6602c44e95862d28e05591798d790d0ad80dfb (patch)
treec74f626a2179740f3901eae226591e3152dbea0f /rational.c
parentb916c39db4adeea4816d99935e253abf1eb48fc7 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@15896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 841a017bc6..fe7ec37b8d 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);
}
}