Android examples for java.lang:Math Formula
Formula to calculate square Root
import java.text.DecimalFormat; public class Main{ public static double squareRoot(double value) throws InvalidInputException { if (value >= 0) { return Math.sqrt(value); } else {// w w w . ja v a 2s .com throw new InvalidInputException(); } } }