End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
BigMath#sqrt
sqrt(decimal, numeric) → BigDecimal
ext/bigdecimal/lib/bigdecimal/math.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/bigdecimal/lib/bigdecimal/math.rb, line 43
def sqrt(x, prec)
x.sqrt(prec)
end
Computes the square root of decimal to the specified number of digits of precision, numeric.
Example
BigMath.sqrt(BigDecimal('2'), 16).to_s #=> "0.1414213562373095048801688724e1"