tags:

views:

586

answers:

2

Are there any libraries for Square Root over BigDecimal in Java?

+7  A: 

Try Big Square Roots. It uses the Newton's method for approximating solutions such as square roots.

cletus
A: 

(This is may not be a solution for you)

As long as your BigDecimal is in the range of double, you can convert the BigDecimal to double, use Math.sqrt() and promote the double back to BigDecimal. It will probably be faster than carrying out the calculation on BigDecimals. In many cases the loss of precision due to conversion between types will be negligible compared to the inevitable error in computing the square root.

quant_dev