diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 09:16:44 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 09:16:44 +0000 |
| commit | 6c0f7d19ba97b0a2116004d830a2565c2c0836d4 (patch) | |
| tree | bd4302887daa89a2bd812c24a06f8e8562bea1ff /rational.c | |
| parent | f4d964bb723791f06ae2135b2dfce368c34c1b99 (diff) | |
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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
| -rw-r--r-- | rational.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rational.c b/rational.c index 0dc445dfb..6d31c542a 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", |
