IEEE 754 转换的问题
TitleTemp(i+10) ... (i+13) => EE C8 F0 BE --> 原始资料----------------------------------------------------------
unsigned int Result_T = sum((i + 10),(i + 13),TitleTemp); //sum => MSB计算成真实数值
float Result=0;
memcpy(&Result, &Result_T, sizeof(float));
printf("%f",Result);
----------------------------------------------------------
算出来的Result数值~当有需要时再倒回去~
unsigned int FloatToHalf(float value)
{
union IEEE
{
float f;
int i;
unsigned int dw;
} ;
IEEE xxx;
xxx.f = value;
return xxx.dw;
}
----------------------------------------------------------
为啥会不一样?错在哪?要怎写才会一样?
每次都会有些微差距...