I agree that the algorithm name should appear somewhere.
I would probably refactor the code as Jeff says, but add a comment that describes the function, probably with details about why it's implemented the way it is.
I would probably refactor the code as Jeff says, but add a comment that describes the function, probably with details about why it's implemented the way it is.
Ideally I'd even like to see a brief comment on why Newton-Raphson was chosen as well. Is there a good reason why I shouldn't replace that code with some other square root approximation technique or was it chosen because it was the only algorithm the author knew?