Subj : Re: sqrt algo To : comp.programming From : Arthur J. O'Dwyer Date : Thu Jul 14 2005 05:54 pm On Thu, 14 Jul 2005, Martijn wrote: [Someone else wrote:] >> Here is an iterative one (from the ancient Egypt, I have been told): >> >> current_estimate = 0.5*(previous_estimate + number/previous_estimate) >> >> You'll have to terminate it when you are "close enough". (It >> converges quite quickly, the number itself may serve as the first >> estimate.) > > In which case you might as well take 1. I suspect you've misunderstood the relative precedence of + and / in the above formula. :) -Arthur, only for very small values of n .