Date: Tue, 29 Oct 1996 14:34:52 -0800 There is obviously some sort of successive approximation type algorithm for doing it to however many decimal places is required, but what is the algorithm? any help much appreciated Ben. Hi Ben: You are correct about the successive approximation algorithm for calculating square roots. There are many such algorithms but I will only show you one, the most rudimentary. This procedure will work for square roots, cube roots, fourth roots and in many other situations as well. I will illustrate it by finding the square root of 2. To simplify the notation let r be the square root of 2. We need to start with an interval that contains r, here start with the interval from l=1 to u=2. Divide the interval in half, decide which half contains r to get an interval that contains r with half the length of the previous one then start again. More explicitly: - Let m = (l+u)/2
- Compare m
^{2}to 2- If m
^{2}> 2 then let u = m - If m
^{2}< 2 then let l = m
- If m
- Return to step 1
Harley To return to the previous page use your browser's back button. |