*(p1)
public
Show source
static VALUE
nurat_mul(VALUE self, VALUE other)
{
if (RB_INTEGER_TYPE_P(other)) {
{
get_dat1(self);
return f_muldiv(self,
dat->num, dat->den,
other, ONE, '*');
}
}
else if (RB_FLOAT_TYPE_P(other)) {
return DBL2NUM(nurat_to_double(self) * RFLOAT_VALUE(other));
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
{
get_dat2(self, other);
return f_muldiv(self,
adat->num, adat->den,
bdat->num, bdat->den, '*');
}
}
else {
return rb_num_coerce_bin(self, other, '*');
}
}