说明如下
three bytes of date in the range 1.5e-45..3.4e+38 plus sign and
zero value. the type is identical to intel's single type(4 bytes)
with the least significant byte truncated the value is stored with
the least significant byte first .see description belowmost significant byte | | least significant byte |
byte 3 | byte2 | byte1 |
1 bit | 8 bits | 15 bits |
s | e | f |if 0<e<255 then value=(-1)^s * 2^(e-127)*(1.f)
if e=0 and f!= 0 then value=(-1)^s*2^-126*0.f
if e=0 and f=0 then value=(-1)^s*0
if e=255 and f=0 then value=(-1)^s*inf
if e=255 and f!=0 then value=nan(inf=infinity nan=not a number)以上上 E文的说明书说明
现在 有3个字节 比如 0x09, 0xF3 ,0x41 这按上面的算法算出来的是多少啊??? 我一直算不对
各位老大 能不能帮个忙 这问题困扰我快一年了 谢谢大家了 我算出来的是 20.712 保留3位 可是不对!!。
谢谢大家了。
three bytes of date in the range 1.5e-45..3.4e+38 plus sign and
zero value. the type is identical to intel's single type(4 bytes)
with the least significant byte truncated the value is stored with
the least significant byte first .see description belowmost significant byte | | least significant byte |
byte 3 | byte2 | byte1 |
1 bit | 8 bits | 15 bits |
s | e | f |if 0<e<255 then value=(-1)^s * 2^(e-127)*(1.f)
if e=0 and f!= 0 then value=(-1)^s*2^-126*0.f
if e=0 and f=0 then value=(-1)^s*0
if e=255 and f=0 then value=(-1)^s*inf
if e=255 and f!=0 then value=nan(inf=infinity nan=not a number)以上上 E文的说明书说明
现在 有3个字节 比如 0x09, 0xF3 ,0x41 这按上面的算法算出来的是多少啊??? 我一直算不对
各位老大 能不能帮个忙 这问题困扰我快一年了 谢谢大家了 我算出来的是 20.712 保留3位 可是不对!!。
谢谢大家了。
_Uint16Bytes[1]=0xF3;
_Uint16Bytes[2]=0x41; System.BitConverter.ToSingle(_Uint16Bytes, 0); System.BitConverter.ToInt32(_Uint16Bytes, 0);改成32位.. 不行自己换下位置看看.
你给的是4个字节的转换