D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Numeric
/
Filename :
divmod-i.ri
back
Copy
U:RDoc::AnyMethod[iI"divmod:ETI"Numeric#divmod;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"5Returns a 2-element array <tt>[q, r]</tt>, where;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"8q = (self/other).floor # Quotient ;TI"9r = self % other # Remainder ;T:@format0o; ; [I"/Of the Core and Standard Library classes, ;TI",only Rational uses this implementation.;T@o; ; [I"Examples:;T@o;; [I"=Rational(11, 1).divmod(4) # => [2, (3/1)] ;TI"?Rational(11, 1).divmod(-4) # => [-3, (-1/1)] ;TI">Rational(-11, 1).divmod(4) # => [-3, (1/1)] ;TI">Rational(-11, 1).divmod(-4) # => [2, (-3/1)] ;TI" ;TI"=Rational(12, 1).divmod(4) # => [3, (0/1)] ;TI">Rational(12, 1).divmod(-4) # => [-3, (0/1)] ;TI">Rational(-12, 1).divmod(4) # => [-3, (0/1)] ;TI"=Rational(-12, 1).divmod(-4) # => [3, (0/1)] ;TI" ;TI";Rational(13, 1).divmod(4.0) # => [3, 1.0] ;TI">Rational(13, 1).divmod(Rational(4, 11)) # => [35, (3/11)];T; 0: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"divmod(other) -> array ;T0[ I" (p1);T@(FI"Numeric;TcRDoc::NormalClass00