Here an “Indy” way to calculate an (approximate) squareRoot
public class CalcSquareRoot {
public static void main(String[] args)
{
//number to calc root of
double base=544.5;
double adder=1;
double sum=0;
double counter=0;
double comp = base*1000000;
while(sum<comp) {counter++;sum+=adder;adder+=2;}
System.out.println("for "+ base + "\n root is about: "+(counter/1000) + "\n actual root is: " + Math.sqrt(base));
}
}
A similar method was used in the very first pocket calculators.