diff options
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 b5c93caa60..3fb0b2a043 100644 --- a/rational.c +++ b/rational.c @@ -900,6 +900,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", |