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
/
Math
/
//opt/alt/ruby27/share/ri/system/Math/sqrt-c.ri
U:RDoc::AnyMethod[iI" sqrt:ETI"Math::sqrt;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"1Returns the non-negative square root of +x+.;To:RDoc::Markup::BlankLine o; ; [I"Domain: [0, INFINITY);T@o; ; [I"Codomain:[0, INFINITY);T@o:RDoc::Markup::Verbatim; [I"0.upto(10) {|x| ;TI", p [x, Math.sqrt(x), Math.sqrt(x)**2] ;TI"} ;TI"#=> [0, 0.0, 0.0] ;TI"# [1, 1.0, 1.0] ;TI"## [2, 1.4142135623731, 2.0] ;TI"$# [3, 1.73205080756888, 3.0] ;TI"# [4, 2.0, 4.0] ;TI"$# [5, 2.23606797749979, 5.0] ;TI"$# [6, 2.44948974278318, 6.0] ;TI"$# [7, 2.64575131106459, 7.0] ;TI"$# [8, 2.82842712474619, 8.0] ;TI"# [9, 3.0, 9.0] ;TI"&# [10, 3.16227766016838, 10.0] ;T:@format0o; ; [I"BNote that the limited precision of floating point arithmetic ;TI"&might lead to surprising results:;T@o;; [I"=Math.sqrt(10**46).to_i #=> 99999999999999991611392 (!) ;T; 0o; ; [I"/See also BigDecimal#sqrt and Integer.sqrt.;T: @fileI"math.c;T:0@omit_headings_from_table_of_contents_below0I"Math.sqrt(x) -> Float ;T0[ I" (p1);T@/FI" Math;TcRDoc::NormalModule00