javascript square root
var x = Math.sqrt(num);
java bigdecimal third root
public static long ITER = 1000;
public static BigDecimal cuberoot(BigDecimal b) {
// Specify a math context with 40 digits of precision.
MathContext mc = new MathContext(40);
BigDecimal x = new BigDecimal("1", mc);
// Search for the cube root via the Newton-Raphson loop. Output each // successive iteration's value.
for (int i = 0; i < ITER; i++) {
x = x.subtract(
x.pow(3, mc)
.subtract(b, mc)
.divide(new BigDecimal("3", mc).multiply(
x.pow(2, mc), mc), mc), mc);
}
return x;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us