如何将这些字节转换为浮动?
\ x00 \ x16 7g
\ x8d \ xed 6g
\ x1a \ x16 7g
\ x00 \ x00 \ x16 7g
5e 7g
这些是btcusdt的价格数据。因此,也许像44xxxxx.xxx 45xxxx.xxx一样。这个数字如何制造?我听不懂。我只知道\ x是六NUMBER,其他可能是ASCII代码。
\x00 \x16 7G
\x8d \xed 6G
\x1a \x16 7G
\x00 \x16 7G
5E 7G
These is BTCUSDT PRICE data.. so maybe presented like 44xxx.xxx 45xxx.xxx. How can this number make? I can't understand. What i only know is \x is hexnumber and others are maybe ASCII CODES.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您拥有的字节是IEEE-754编码46870、46829.55078125、46870.1015625、46870和46917.20703125。
要解码它们,请按小订单将字节复制到
float
对象中,然后将它们解释为float
对象。如何执行此操作的详细信息将取决于所使用的编程语言,该问题不指出。要手动解码它们,请写出每个四个字节的32位,首先是第四个字节的位(在高价值位置),然后是第三个字节的位,然后是第二个字节,然后是第一个。从这32位,将第一个作为标志位 s 。将接下来的八个作为指数代码 e 的位。将最后23个作为显着的代码 f 的位。
解码符号位:让 s =(-1) s 。
解码指数位:将它们解释为未签名的八位数字, e 。然后:
解码显着范围:令 f = f f + f •2 -23 。
表示的数字为 s • f •2 e 。
The bytes you have are IEEE-754 encodings of the numbers 46870, 46829.55078125, 46870.1015625, 46870, and 46917.20703125.
To decode them, copy the bytes into a
float
object in little-endian order, then interpret them as thatfloat
object. Details of how to do this will depend on the programming language used, which the question does not state.To decode them manually, write out the 32 bits of each four bytes, with the bits of the fourth byte first (in the high-value positions), then the bits of the third byte, then the second, then the first. From those 32 bits, take the first one as a sign bit s. Take the next eight as bits for an exponent code e. Take the last 23 as bits for a significand code f.
Decode the sign bit: Let S = (−1)s.
Decode the exponent bits: Interpret them as an unsigned eight-bit numeral, e. Then:
Decode the significand bits: Let F = F + f•2−23.
The number represented is S • F • 2E.