📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 17:42:25
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
Numeric
📍 /opt/alt/ruby31/share/ri/system/Numeric
🔄 Refresh
✏️
Editing: modulo-i.ri
Read Only
U:RDoc::AnyMethod[iI"modulo:ETI"Numeric#modulo;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"4Returns +self+ modulo +other+ as a real number.;To:RDoc::Markup::BlankLine o; ; [I"/Of the Core and Standard Library classes, ;TI",only Rational uses this implementation.;T@o; ; [I"MFor \Rational +r+ and real number +n+, these expressions are equivalent:;T@o:RDoc::Markup::Verbatim; [I"c % n ;TI"c-n*(c/n).floor ;TI"c.divmod(n)[1] ;T:@format0o; ; [I"See Numeric#divmod.;T@o; ; [I"Examples:;T@o;; [I"&r = Rational(1, 2) # => (1/2) ;TI"&r2 = Rational(2, 3) # => (2/3) ;TI"&r % r2 # => (1/2) ;TI"&r % 2 # => (1/2) ;TI"$r % 2.0 # => 0.5 ;TI" ;TI"*r = Rational(301,100) # => (301/100) ;TI"&r2 = Rational(7,5) # => (7/5) ;TI")r % r2 # => (21/100) ;TI"+r % -r2 # => (-119/100) ;TI"*(-r) % r2 # => (119/100) ;TI"*(-r) %-r2 # => (-21/100) ;T; 0o; ; [I".Numeric#modulo is an alias for Numeric#%.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@2FI"Numeric;TcRDoc::NormalClass0[@5FI"%;T
💾 Save Changes
❌ Cancel