conversion from 'double' to 'int', possible loss of data 一直有这个错误
原程序 取绝对值
double x=0,y=0;
y=gongchadaizhongxin-junzhi;
x=_T(abs(double (y)));
取平方根 有这个错误
float a[100];
double e = 0;
double s = 0;
double sum = 0;
for (int t = 0; t<i; t++)
{
sum += a[t]; //总和
}
UpdateData(false);
junzhi=sum/i; //均值
UpdateData(false);
for (int t = 0; t <i; t++)
{
e+=(a[t]-junzhi)*(a[t]-junzhi);
}
e/=i-1;
s=e^(0.5);
'^' : illegal, left operand has type 'float [100]'
'^' : illegal, right operand has type 'double'
原程序 取绝对值
double x=0,y=0;
y=gongchadaizhongxin-junzhi;
x=_T(abs(double (y)));
取平方根 有这个错误
float a[100];
double e = 0;
double s = 0;
double sum = 0;
for (int t = 0; t<i; t++)
{
sum += a[t]; //总和
}
UpdateData(false);
junzhi=sum/i; //均值
UpdateData(false);
for (int t = 0; t <i; t++)
{
e+=(a[t]-junzhi)*(a[t]-junzhi);
}
e/=i-1;
s=e^(0.5);
'^' : illegal, left operand has type 'float [100]'
'^' : illegal, right operand has type 'double'