大量字节范围
我很难理解这一点,希望有人能纠正我。 BYTE 定义为 0 - 2^7 ?哪个是 128,哪个是 8 位,对吗?但这不可能是正确的,因为我现在将值 255 存储到 BYTE 中?任何朝正确方向的踢都会有帮助
I am having a hard time understanding this and hopefully someone can correct me on it. A BYTE is defined as 0 - 2^7 ? which would be 128, which is 8 bits, correct? But that cant be correct because I am now storing a value of 255 into a BYTE? Any kick in the right direction would be helpful
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个无符号字节是2^8 = 256,但是如果你必须存储符号,你需要牺牲一点,那么你就有+- 2^7 = -127 + 128。
An unsigned byte is 2^8 = 256, but if you have to store the sign, the you need to sacrify a bit, then you have +- 2^7 = -127 + 128.