Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Integer
/
//opt/alt/ruby27/share/ri/system/Integer/sqrt-c.ri
U:RDoc::AnyMethod[iI" sqrt:ETI"Integer::sqrt;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FReturns the integer square root of the non-negative integer +n+, ;TI"Ei.e. the largest non-negative integer less than or equal to the ;TI"square root of +n+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I""Integer.sqrt(0) #=> 0 ;TI""Integer.sqrt(1) #=> 1 ;TI""Integer.sqrt(24) #=> 4 ;TI""Integer.sqrt(25) #=> 5 ;TI"(Integer.sqrt(10**400) #=> 10**200 ;T:@format0o; ; [I"@Equivalent to <code>Math.sqrt(n).floor</code>, except that ;TI"Bthe result of the latter code may differ from the true value ;TI"?due to the limited precision of floating point arithmetic.;T@o;; [I";Integer.sqrt(10**46) #=> 100000000000000000000000 ;TI"?Math.sqrt(10**46).floor #=> 99999999999999991611392 (!) ;T; 0o; ; [I"DIf +n+ is not an Integer, it is converted to an Integer first. ;TI"7If +n+ is negative, a Math::DomainError is raised.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I""Integer.sqrt(n) -> integer ;T0[ I" (p1);T@%FI"Integer;TcRDoc::NormalClass00