Found this method to find the square root of a number interesting – if x is an overestimate of the square root of a number, then number/x should be an underestimate and the mean of this should get you closer to the square root.
Here’s the java code:
double sqrt(double n) { double previous = 0, current = n/2; do{ previous = current; current = (previous + n/previous)/2; } while (previous - current != 0); return current; }