jjzjj

lastGuess

全部标签

c++ - 在巴比伦算法中为 C++ 中的平方根获取无限循环

我已经在整个Internet上彻底搜索了这个主题,线程要么死了,要么使用了与我书中描述的方法不同的方法。例如,http://www.geeksforgeeks.org/square-root-of-a-perfect-square/.这对我不起作用,因为我的算法需要循环直到达到最后“猜测”的1%。这是文本中的问题。TheBabylonianalgorithmtocomputethesquarerootofanumbernisasfollows:Makeaguessatthenumber(youcanpickn/2asyourinitialguess).Computer=n/guessS