C#中byte[]4位数组转换为float类型浮点数

C#中byte[]4位数组转换为float类型浮点数:

float占4位,byte占1位,4个byte可以转换为一个浮点数。

byte[] byteTemp = new byte[8] { 0x76, 0x83, 0x33, 0x45 }; 
float fTemp = BitConverter.ToSingle(byteTemp, 0);

 

posted @ 2020-04-27 20:33  小大大小  阅读(15960)  评论(0编辑  收藏  举报