参考链接: https://blog.csdn.net/kingsollyu/article/details/8270168
浮点数采用科学计数法表示。
测试代码:16进制转float型
#include <stdio.h>
int main(int agrc, char *argv[])
{
unsigned char hexData[] = {0x89, 0x29, 0x23, 0x43};
float *heading =(float *)hexData;
printf("%g\n", *heading);
}
float pi = 3.14f;
unsigned char *buff = (unsigned char *)π
for(int i =0; i<4; i++)
{
printf("0x%2x ", buff[i]);
}
}