D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
/
Filename :
modulo-i.ri
back
Copy
U:RDoc::AnyMethod[iI"modulo:ETI"Integer#modulo;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"4Returns +self+ modulo +other+ as a real number.;To:RDoc::Markup::BlankLine o; ; [I"KFor integer +n+ and real number +r+, these expressions are equivalent:;T@o:RDoc::Markup::Verbatim; [I"n % r ;TI"n-r*(n/r).floor ;TI"n.divmod(r)[1] ;T:@format0o; ; [I"See Numeric#divmod.;T@o; ; [I"Examples:;T@o;; [I" 10 % 2 # => 0 ;TI" 10 % 3 # => 1 ;TI" 10 % 4 # => 2 ;TI" ;TI" 10 % -2 # => 0 ;TI"!10 % -3 # => -2 ;TI"!10 % -4 # => -2 ;TI" ;TI""10 % 3.0 # => 1.0 ;TI"#10 % Rational(3, 1) # => (1/1);T; 0: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@)FI"Integer;TcRDoc::NormalClass0[@,FI"%;T