参考链接 https://www.cnblogs.com/cheng07045406/p/3362544.html
double sqrt(double a)
{
double x,y;
x=0.0;
y=a/2;
while(x!=y)
{
x=y;
y=(x+a/x)/2;
}
return x;
}
c 语言重写sqrt
最新推荐文章于 2024-11-07 23:24:32 发布
参考链接 https://www.cnblogs.com/cheng07045406/p/3362544.html
double sqrt(double a)
{
double x,y;
x=0.0;
y=a/2;
while(x!=y)
{
x=y;
y=(x+a/x)/2;
}
return x;
}