summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 948e162345..33969c400c 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1969,6 +1969,9 @@ rb_big_coerce(x, y)
if (FIXNUM_P(y)) {
return rb_assoc_new(rb_int2big(FIX2LONG(y)), x);
}
+ else if (TYPE(y) == T_BIGNUM) {
+ return rb_assoc_new(y, x);
+ }
else {
rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
rb_obj_classname(y));