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;
}
posted @ 2018-12-24 11:46  hbg-rohens  阅读(2827)  评论(0编辑  收藏  举报