标签:
求平方根
class SqRoot{
void calcRoot(double z){
double x=1;double y=z/x;
while(Math.abs(x-y)>1E-10)
{
x=0.5*(x+y); y=z/x;
}
System.out.println(x);
algorithm
原文地址:http://www.cnblogs.com/jack-xu/p/4810515.html