二分法求平方根 C语言Approximatesquare root with bisection methodINPUT:Argument x,endpoint values a,b,such that a < bOUTPUT:value which differs from sqrt(x) by less than 1done= 0a= 0b= square root of largest possible argument (e.g.2的16次
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/17 20:04:49
![二分法求平方根 C语言Approximatesquare root with bisection methodINPUT:Argument x,endpoint values a,b,such that a < bOUTPUT:value which differs from sqrt(x) by less than 1done= 0a= 0b= square root of largest possible argument (e.g.2的16次](/uploads/image/z/11665124-44-4.jpg?t=%E4%BA%8C%E5%88%86%E6%B3%95%E6%B1%82%E5%B9%B3%E6%96%B9%E6%A0%B9+C%E8%AF%AD%E8%A8%80Approximatesquare+root+with+bisection+methodINPUT%3AArgument+x%2Cendpoint+values+a%2Cb%2Csuch+that+a+%3C+bOUTPUT%3Avalue+which+differs+from+sqrt%28x%29+by+less+than+1done%3D+0a%3D+0b%3D+square+root+of+largest+possible+argument+%28e.g.2%E7%9A%8416%E6%AC%A1)
二分法求平方根 C语言Approximatesquare root with bisection methodINPUT:Argument x,endpoint values a,b,such that a < bOUTPUT:value which differs from sqrt(x) by less than 1done= 0a= 0b= square root of largest possible argument (e.g.2的16次
二分法求平方根 C语言
Approximatesquare root with bisection method
INPUT:Argument x,endpoint values a,b,such that a < b
OUTPUT:value which differs from sqrt(x) by less than 1
done= 0
a= 0
b= square root of largest possible argument (e.g.2的16次方).
c= -1
do{
c_old
二分法求平方根 C语言Approximatesquare root with bisection methodINPUT:Argument x,endpoint values a,b,such that a < bOUTPUT:value which differs from sqrt(x) by less than 1done= 0a= 0b= square root of largest possible argument (e.g.2的16次
在给定的区间单调,对应的函数就可以用二分法计算根.平方根函数符合这个条件,当然可以用二分法求解.
上述程序片段是一段伪代码,