First page Back Continue Last page Overview Graphics

Computing Square Roots

Perhaps the first algorithm used for approximating Sāˆ’āˆ’āˆš is known as the "Babylonian method", named after the Babylonians,[1] or "Hero's method", named after the first-century Greek mathematician Hero of Alexandria who gave the first explicit description of the method.

If a nmber x is close to the square root of a then y = (x + a/x)/2 will be a beter approximation.

Exercise:

Write a program to calculate the square root of a number by using the Babylonian method..