PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
U:RDoc::AnyMethod[iI" sqrt:ETI"Integer::sqrt;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FReturns the integer square root of the non-negative integer +n+, ;TI"Iwhich is the largest non-negative integer less than or equal to the ;TI"square root of +numeric+.;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"EIf +numeric+ is not an \Integer, it is converted to an \Integer:;T@o;; [ I")Integer.sqrt(Complex(4, 0)) # => 2 ;TI")Integer.sqrt(Rational(4, 1)) # => 2 ;TI")Integer.sqrt(4.0) # => 2 ;TI")Integer.sqrt(3.14159) # => 1 ;T; 0o; ; [I"EThis method is equivalent to <tt>Math.sqrt(numeric).floor</tt>, ;TI"Nexcept that the 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"2Raises an exception if +numeric+ is negative.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"&Integer.sqrt(numeric) -> integer ;T0[ I" (p1);T@-FI"Integer;TcRDoc::NormalClass00
[-] chr-i.ri
[edit]
[-] coerce-i.ri
[edit]
[-] to_f-i.ri
[edit]
[-] bit_length-i.ri
[edit]
[-] %2d-i.ri
[edit]
[-] anybits%3f-i.ri
[edit]
[-] integer%3f-i.ri
[edit]
[-] allbits%3f-i.ri
[edit]
[-] upto-i.ri
[edit]
[-] magnitude-i.ri
[edit]
[-] size-i.ri
[edit]
[-] %7c-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[-] %3c%3c-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] %2a-i.ri
[edit]
[-] %3c%3d-i.ri
[edit]
[-] nobits%3f-i.ri
[edit]
[-] %3c-i.ri
[edit]
[-] numerator-i.ri
[edit]
[-] %3c%3d%3e-i.ri
[edit]
[-] rationalize-i.ri
[edit]
[-] modulo-i.ri
[edit]
[-] remainder-i.ri
[edit]
[-] ceil-i.ri
[edit]
[-] to_r-i.ri
[edit]
[-] sqrt-c.ri
[edit]
[-] cdesc-Integer.ri
[edit]
[-] %2a%2a-i.ri
[edit]
[-] %26-i.ri
[edit]
[-] downto-i.ri
[edit]
[-] %3e-i.ri
[edit]
[-] floor-i.ri
[edit]
[-] divmod-i.ri
[edit]
[-] round-i.ri
[edit]
[-] to_int-i.ri
[edit]
[-] %2d%40-i.ri
[edit]
[-] denominator-i.ri
[edit]
[-] %2f-i.ri
[edit]
[-] abs-i.ri
[edit]
[-] zero%3f-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] to_bn-i.ri
[edit]
[-] odd%3f-i.ri
[edit]
[-] times-i.ri
[edit]
[-] pred-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] to_i-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] truncate-i.ri
[edit]
[-] digits-i.ri
[edit]
[-] %3e%3e-i.ri
[edit]
[-] pow-i.ri
[edit]
[+]
..
[-] gcdlcm-i.ri
[edit]
[-] fdiv-i.ri
[edit]
[-] %2b-i.ri
[edit]
[-] %3e%3d-i.ri
[edit]
[-] even%3f-i.ri
[edit]
[-] lcm-i.ri
[edit]
[-] succ-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] ceildiv-i.ri
[edit]
[-] div-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] %7e-i.ri
[edit]
[-] gcd-i.ri
[edit]
[-] %5e-i.ri
[edit]
[-] ord-i.ri
[edit]
[-] next-i.ri
[edit]