method
quo
v1_9_1_378 -
Show latest stable
- Class:
Complex
quo(p1)public
No documentation available.
static VALUE
nucomp_div(VALUE self, VALUE other)
{
if (k_complex_p(other)) {
get_dat2(self, other);
if (TYPE(adat->real) == T_FLOAT ||
TYPE(adat->imag) == T_FLOAT ||
TYPE(bdat->real) == T_FLOAT ||
TYPE(bdat->imag) == T_FLOAT) {
VALUE magn = m_hypot(bdat->real, bdat->imag);
VALUE tmp = f_complex_new_bang2(CLASS_OF(self),
f_div(bdat->real, magn),
f_div(bdat->imag, magn));
return f_div(f_mul(self, f_conj(tmp)), magn);
}
return f_div(f_mul(self, f_conj(other)), f_abs2(other));
}
if (k_numeric_p(other) && f_real_p(other)) {
get_dat1(self);
return f_complex_new2(CLASS_OF(self),
f_div(dat->real, other),
f_div(dat->imag, other));
}
return rb_num_coerce_bin(self, other, '/');
}