C语言 16进制转float
float hex_to_float(uint8_t *data)
{
float num = 0.0;
uint8_t dd[4] = {data[0], data[1], data[2], data[3]};
float *ret = (float *)dd;
num = *ret;
printf("float vlaue : %f\n", num);
return num;
}
float hex_to_float(uint8_t *data)
{
float num = 0.0;
uint8_t dd[4] = {data[0], data[1], data[2], data[3]};
float *ret = (float *)dd;
num = *ret;
printf("float vlaue : %f\n", num);
return num;
}