What are good alternatives to Math.pow
and Math.sqrt
? I'm looking for something a little more accurate. Usually these are accurate enough, however when I put a double through the algorithm I'm using, the returned value is just slightly false. I did the math by hand, and did each step-by-step calculation inside the algorithm using java, and I discovered that the problem lied within the innacuracy of the Math.pow
and Math.sqrt
methods.
I was fooling around with the BigDecimal
class but I'm not sure about it's use here.
I rechecked it, It's the Double value that is too imprecise. Is there any Math method equivalents for the BigDecimal class?