Method: BigMath.sqrt
- Defined in:
- lib/bigdecimal/math.rb
.sqrt(x, prec) ⇒ Object
call-seq:
sqrt(decimal, numeric) -> BigDecimal
Computes the square root of decimal to the specified number of digits of precision, numeric.
BigMath.sqrt(BigDecimal.new('2'), 16).to_s
#=> "0.1414213562373095048801688724E1"
42 43 44 |
# File 'lib/bigdecimal/math.rb', line 42 def sqrt(x, prec) x.sqrt(prec) end |