Check the algorithm for newton's ramson formula .. Actually wahtever you wrote the program that is by Iterative evaluation of a square root
check here also...
http://www.macs.hw.ac.uk/~pjbk/pathw...1/node124.html