From c2d571c37feb7b9f35e4653717422ae79b13312c Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 21 Jun 2009 09:16:44 +0000 Subject: merges r23718 from trunk into ruby_1_9_1. -- * complex.c (nucomp_coerce): accepts Complex instances. * rational.c (nurat_coerce): accepts Rational instances. [ruby-core:23859] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rational.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rational.c') diff --git a/rational.c b/rational.c index 0dc445dfba..6d31c542ad 100644 --- a/rational.c +++ b/rational.c @@ -902,6 +902,8 @@ nurat_coerce(VALUE self, VALUE other) return rb_assoc_new(f_rational_new_bang1(CLASS_OF(self), other), self); case T_FLOAT: return rb_assoc_new(other, f_to_f(self)); + case T_RATIONAL: + return rb_assoc_new(other, self); } rb_raise(rb_eTypeError, "%s can't be coerced into %s", -- cgit v1.2.3