1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rb_numeric_quo: support Complex

This commit is contained in:
Nobuyoshi Nakada 2019-08-10 23:19:24 +09:00
parent c1c8577088
commit 52bd4716b4
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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);
}