File: C:/Ruby27-x64/share/ri/2.7.0/system/Numeric/divmod-i.ri
U:RDoc::AnyMethod[iI"divmod:ETI"Numeric#divmod;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"OReturns an array containing the quotient and modulus obtained by dividing ;TI"+num+ by +numeric+.;To:RDoc::Markup::BlankLine o;
; [I"-If <code>q, r = x.divmod(y)</code>, then;T@o:RDoc::Markup::Verbatim; [I"q = floor(x/y)
;TI"x = q*y + r
;T:@format0o;
; [I"GThe quotient is rounded toward negative infinity, as shown in the ;TI"following table:;T@o;; [I"J a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b)
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"A 13 | 4 | 3, 1 | 3 | 1 | 1
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"A 13 | -4 | -4, -3 | -4 | -3 | 1
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"A-13 | 4 | -4, 3 | -4 | 3 | -1
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"A-13 | -4 | 3, -1 | 3 | -1 | -1
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"C 11.5 | 4 | 2, 3.5 | 2.875 | 3.5 | 3.5
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"C 11.5 | -4 | -3, -0.5 | -2.875 | -0.5 | 3.5
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"C-11.5 | 4 | -3, 0.5 | -2.875 | 0.5 | -3.5
;TI"J------+-----+---------------+---------+-------------+---------------
;TI"C-11.5 | -4 | 2, -3.5 | 2.875 | -3.5 | -3.5
;T;
0o;
; [I"
Examples;T@o;; [
I"$11.divmod(3) #=> [3, 2]
;TI"&11.divmod(-3) #=> [-4, -1]
;TI"&11.divmod(3.5) #=> [3, 0.5]
;TI"'(-11).divmod(3.5) #=> [-4, 3.0]
;TI"%11.5.divmod(3.5) #=> [3, 1.0];T;
0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"$num.divmod(numeric) -> array
;T0[ I" (p1);T@8FI"Numeric;TcRDoc::NormalClass00