b:=(adoquery2.RecordCount*exy-ex*ey)/(adoquery2.RecordCount*ex2-ex*ex);showmessage('exy='+floattostr(exy)+' ex='+floattostr(ex)+' b='+floattostr(b)); //注意这句。 a:=(ey-b*ex)/adoquery2.RecordCount; ex:=strtofloat(s1);
while ex<=strtofloat(s2) do
begin
showmessage(floattostr(b)+' '+floattostr(ex)+' '+floattostr(a)); //相关语句
series1.AddXY(ex,b*ex+a,'',clgreen);
ex:=ex+0.1;
end;************************
这里的a,b,exy,ex,ey,ex2等都是real类型的 奇怪的是,如果有第二句的showmessage(),则倒数第4句的showmessage()就显示正确的数比如1.122234411 0.1 12.3453576,而注释掉第二句,则倒数第4句的showmessage就显示:
NAN 0.1 NAN 或 NAN 0.2 NAN
请教这是为什么啊?他们有什么关系啊?
while ex<=strtofloat(s2) do
begin
showmessage(floattostr(b)+' '+floattostr(ex)+' '+floattostr(a)); //相关语句
series1.AddXY(ex,b*ex+a,'',clgreen);
ex:=ex+0.1;
end;************************
这里的a,b,exy,ex,ey,ex2等都是real类型的 奇怪的是,如果有第二句的showmessage(),则倒数第4句的showmessage()就显示正确的数比如1.122234411 0.1 12.3453576,而注释掉第二句,则倒数第4句的showmessage就显示:
NAN 0.1 NAN 或 NAN 0.2 NAN
请教这是为什么啊?他们有什么关系啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货