【发布时间】:2021-12-08 16:30:36
【问题描述】:
使用 c#
我需要读取的浮点值
= 24.500000
当我尝试阅读时,我得到了这个结果
= 1103364096
我应该如何转换才能获得真正的价值?我需要这方面的帮助。
我的失败尝试:
int data_1 = 1103364096;
UInt16 value = (UInt16)x;
ushort data_2= (ushort)(1103364096 & ((1 << 16) - 1));
int r = 1103364096;
short trimmed = unchecked((short)r);
这些都行不通!
【问题讨论】:
-
您在寻找
BitConverter吗? docs.microsoft.com/en-us/dotnet/api/…
标签: c# type-conversion integer