为什么八进制的 0128 被认为不能转换为十进制?
我正在练习考试,我正在做文字,我想到的是一个要求将 0128 八进制转换为十进制的问题,所以我也有这个问题的解决方案,那就是它有太多的位被视为八进制,因此它也不能转换为十进制,但没有描述其动机。
你知道为什么吗,因为我想弄清楚,但我还找不到任何答案。
I'm practicing for an exam and I'm doing literals, what came up to me was a question that asked to convert 0128 octal into a decimal , so I also have the solution for this question which is that it has too many bits to be considered an octal so it can't be converted into a decimal as well, but the motivation of it is not described.
Do you know why because I'm trying to figure it out, but I couldn't find any answer yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个答案是“无效输入”,但不同的答案可能是将输入视为“012”,其中第一个非八进制字符充当八进制数的终止符。因此答案是十进制 10。
One answer is "invalid input" but a different answer might be to consider the input as "012" with the first non-octal character acting as the termination of the octal number. The answer would therefore be 10 decimal.