David Knell wrote: > The value returned is an integer which is loosely defined as > about the square root of the number presented. The error > comes from it effectively finding the highest n such that > n > sum n < input/2 > 1 > .... > I guess I could claim that it makes a better job of returning > the nearest integer to the square root of the number than the > previous routines posted. David: It certainly does not. It finds NEARBY integers; not "the nearest" integer. All the previously-posted solutions, on the other hand, DO find the nearest integer. Of course, I could be misunderstanding your claim (your initial comment that your routine finds a number "loosely defined as about the square root" would tend to support this hypothesis). Are you saying, perhaps, that your routine finds the integer nearest to the integer nearest to the square root of the input? -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499