summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 23:19:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 23:19:24 +0900
commit52bd4716b482337bd8f9f8389c5ab9d168fb11f8 (patch)
tree6d725cce49b3c3d9764b8ed337445a2bf05d8e1f /rational.c
parentc1c8577088b1fa36a34ca8b885db441365b27aa7 (diff)
rb_numeric_quo: support Complex
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rational.c b/rational.c
index d032cbd..0dfc8ab 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);
}