小端编码
以下字节序列被编码为 Little Endian Unsigned Int。
F0 00 00 00
我刚刚读到了有关字节序的内容。只是想验证它是否是十进制的 240。
The following byte sequence is encoded as Little Endian Unsigned Int.
F0 00 00 00
I just read about endianness. Just wanted to verify if it is 240 decimal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将字节序列转换为位...
[1111 0000] [0000 0000] [0000 0000] [0000 0000]
将第一个字节转换为十进制...
= 0*2^0 + 0*2^1 + 0*2 ^2 + 0*2^3 + 1*2^4 + 1*2^5 + 1*2^6 + 1*2^7
算算...
= 16 + 32 + 64 + 128 = 240
Translating the byte sequence to bits...
[1111 0000] [0000 0000] [0000 0000] [0000 0000]
Converting the first byte to decimal...
= 0*2^0 + 0*2^1 + 0*2^2 + 0*2^3 + 1*2^4 + 1*2^5 + 1*2^6 + 1*2^7
Doing the math...
= 16 + 32 + 64 + 128 = 240
是的,0x000000F0 = 240。
如果是大尾数,则为 0xF0000000 = 4026531840(如果有符号则为 -268435456)。
Yes, 0x000000F0 = 240.
If it were big-endian, it would be 0xF0000000 = 4026531840 (or -268435456 if signed).