Answer

Yes it's strange, and yes there's a better way. Ideally we would loop, computing better and better approximations, until we calculated a value that was ``close enough'' to the square root to suit us. Unfortunately, a DO loop always runs for a fixed number of iterations. In a future lesson we will see a better way to write the ``SROOT'' function, but in the meantime this is the best we can do.

Return to lesson.



Hamlet Project
hamlet@cs.utah.edu