> 数学 >
编写程序,用二分法求一元二次方程4x2+3x-6=0在(-10,10)区间的根.
人气:310 ℃ 时间:2020-05-19 05:53:46
解答
a=-10;
b=10;
n=0;
while b-a>eps
t=(a+b)/2;
n=n+1;
if 4*t^2+3*t-6==0
break;
elseif (4*a^2+3*a-6)*(4*t^2+3*t-6)>0
a=t;
else b=t;
end;
end;
x=t
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版