From 52bd4716b482337bd8f9f8389c5ab9d168fb11f8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Aug 2019 23:19:24 +0900 Subject: [PATCH] rb_numeric_quo: support Complex --- rational.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rational.c b/rational.c index d032cbd5a7..0dfc8abe12 100644 --- a/rational.c +++ b/rational.c @@ -2014,6 +2014,10 @@ numeric_denominator(VALUE self) VALUE rb_numeric_quo(VALUE x, VALUE y) { + if (RB_TYPE_P(x, T_COMPLEX)) { + return rb_complex_div(x, y); + } + if (RB_FLOAT_TYPE_P(y)) { return rb_funcallv(x, idFdiv, 1, &y); }