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:
parent
c1c8577088
commit
52bd4716b4
1 changed files with 4 additions and 0 deletions
|
@ -2014,6 +2014,10 @@ numeric_denominator(VALUE self)
|
||||||
VALUE
|
VALUE
|
||||||
rb_numeric_quo(VALUE x, VALUE y)
|
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)) {
|
if (RB_FLOAT_TYPE_P(y)) {
|
||||||
return rb_funcallv(x, idFdiv, 1, &y);
|
return rb_funcallv(x, idFdiv, 1, &y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue