I wrote a quick Babylonian method function that appears to work pretty well:

Code:

double my_sqrt(double num)
{
double s = num / 2;
int i;
for(i = 0;i < 5;++i)
s = (s + (num / s)) / 2;
return s;
}

...at least according to my little test:

Code:

for(i = 2;i < 20;++i)
printf("Square root of %d = %f, %f\n", i, my_sqrt(i), sqrt(i));

Output...

Code:

Square root of 2 = 1.414214, 1.414214
Square root of 3 = 1.732051, 1.732051
Square root of 4 = 2.000000, 2.000000
Square root of 5 = 2.236068, 2.236068
Square root of 6 = 2.449490, 2.449490
Square root of 7 = 2.645751, 2.645751
Square root of 8 = 2.828427, 2.828427
Square root of 9 = 3.000000, 3.000000
Square root of 10 = 3.162278, 3.162278
Square root of 11 = 3.316625, 3.316625
Square root of 12 = 3.464102, 3.464102
Square root of 13 = 3.605551, 3.605551
Square root of 14 = 3.741657, 3.741657
Square root of 15 = 3.872983, 3.872983
Square root of 16 = 4.000000, 4.000000
Square root of 17 = 4.123106, 4.123106
Square root of 18 = 4.242641, 4.242641
Square root of 19 = 4.358899, 4.358899