summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-05 14:25:40 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-05 14:25:40 +0000
commitc08b5dfb81c5a79e0c4965ff1a8da07f040c5820 (patch)
treeae0ca032557e77eb17c4f62f73ccf91dbff37498 /rational.c
parentbe710a03919604a1b7776043aecc5cf0914da01c (diff)
* lib/cmath.rb: new.
* lib/complex.rb: depends lib/cmath.rb. * lib/rational.rb: added rdiv. * complex.c: removed some math functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rational.c b/rational.c
index de5c7867c3..2cfe9288be 100644
--- a/rational.c
+++ b/rational.c
@@ -777,13 +777,9 @@ nurat_mul(VALUE self, VALUE other)
}
}
-#define id_to_r rb_intern("to_r")
-#define f_to_r(x) rb_funcall(x, id_to_r, 0)
-
static VALUE
nurat_div(VALUE self, VALUE other)
{
- again:
switch (TYPE(other)) {
case T_FIXNUM:
case T_BIGNUM:
@@ -1407,6 +1403,9 @@ string_to_r(VALUE self)
return rb_rational_new1(INT2FIX(0));
}
+#define id_to_r rb_intern("to_r")
+#define f_to_r(x) rb_funcall(x, id_to_r, 0)
+
static VALUE
nurat_s_convert(int argc, VALUE *argv, VALUE klass)
{