summaryrefslogtreecommitdiff
path: root/progs/a609.py
blob: e45607f182db2f6d82fb87068049ec330ee149ca (plain)
1
2
3
4
5
6
7
8
9
10
def babylonian_squareroot(number):
    if(number == 0):
        return 0;
    g = number/2.0;
    g2 = g + 1;
    while(g != g2):
        n = number/ g;
        g2 = g;
        g = (g + n)/2;
    return g;