UpdateData(TRUE);static float qicha[21][5] = {{0.0f,0.0f,0.0f,0.0f,0.0f},{0.0f,0.0f,0.1f,0.1f,0.1f},{0.0f,0.1f,0.1f,0.1f,0.2f},{0.1f,0.1f,0.2f,0.2f,0.3f},
{0.1f,0.1f,0.2f,0.3f,0.3f},{0.1f,0.2f,0.3f,0.3f,0.4f},{0.1f,0.2f,0.3f,0.4f,0.5f},{0.1f,0.2f,0.4f,0.5f,0.6f},{0.1f,0.3f,0.4f,0.5f,0.7f},{0.2f,0.3f,0.5f,0.6f,0.8f},
{0.2f,0.3f,0.5f,0.7f,0.8f},{0.2f,0.4f,0.6f,0.7f,0.9f},{0.2f,0.4f,0.6f,0.8f,1.0f},{0.2f,0.4f,0.7f,0.9f,1.1f},{0.2f,0.5f,0.7f,0.9f,1.2f},{0.2f,0.5f,0.7f,0.9f,1.2f},{0.3f,0.5f,0.8f,1.0f,1.3f},{0.3f,0.5f,0.8f,1.1f,1.3f},{0.3,0.6f,0.9f,1.1f,1.4f},{0.3f,0.6f,0.9f,1.2f,1.5f},{0.3f,0.6f,1.0f,1.3f,1.6f}
};
float (*p)[5];
p=qicha;
 
m_f9=m_f1-m_f10;
m_f3=m_f2-m_f11;
float m=m_f3-m_f9;
if(abs(m)>=2.0) return;
int mm=abs(m*10);
if(m<0){m_f8=m_f9-*(*(p+mm)+0);
m_f7=m_f9-*(*(p+mm)+1);
m_f6=m_f9-*(*(p+mm)+2);
m_f5=m_f9-*(*(p+mm)+3);
m_f4=m_f9-*(*(p+mm)+4);}
if(m>=0){m_f8=m_f9+*(*(p+mm)+0);
m_f7=m_f9+*(*(p+mm)+1);
m_f6=m_f9+*(*(p+mm)+2);
m_f5=m_f9+*(*(p+mm)+3);
m_f4=m_f9+*(*(p+mm)+4);}

UpdateData(FALSE);
其中MF1-MF11是对话框上的变量,MF1 MF2 MF10 MF11是要输入数据的
求器差分配的,但有个问题,若MF9或MF3其中有一个是0.4的话就会不是
你所求的,但我用同样的算法用在整型数据上就没问题,FLOAT换成DOUBLE也不行。
我用VC6.0英文专业与企业版都试过。
我只好改了算法实现。
感兴趣的我可以给源码看看,