我用的是mega64写的程序,可我遇到了一个太奇怪的问题,从没遇到过的,请看下面这几条语句:
void Cal_real_val(unsigned a) { float t1low,t1high,t3low,t3high; t1low=T1_low[a]; t1high=T1_hig[a]; t3low=T3_low[a]; t3high=T3_hig[a]; Ax=10000*(t1high/(t1high+t1low)-0.5)/0.125; Ay=10000*(t3high/(t3high+t3low)-0.5)/0.125;
}
这里的Ax Ay也是float变量,且为全局变量.从上面的式子可以看出:这里的Ax,Ay要想等于0则要t1low=t1high,t3low=t3high;可当有Ax=0或Ay=0时 t1low!=t1high,t3low!=t3high我实在是搞不懂这是什么原因,希望知道的朋友请告诉我!多谢! |