= private = protected
divmod(p1)
See Numeric#divmod.
42.0.divmod 6 #=> [7, 0.0] 42.0.divmod 5 #=> [8, 2.0]
static VALUE flo_divmod(VALUE x, VALUE y) { double fy, div, mod; volatile VALUE a, b; if (RB_TYPE_P(y, T_FIXNUM)) { fy = (double)FIX2LONG(y); } else if (RB_TYPE_P(y, T_BIGNUM)) { fy = rb_big2dbl(y); } else if (RB_TYPE_P(y, T_FLOAT)) { fy = RFLOAT_VALUE(y); } else { return rb_num_coerce_bin(x, y, id_divmod); } flodivmod(RFLOAT_VALUE(x), fy, &div, &mod); a = dbl2ival(div); b = DBL2NUM(mod); return rb_assoc_new(a, b); }