为什么八进制的 0128 被认为不能转换为十进制?

发布于 2025-01-15 12:59:32 字数 139 浏览 3 评论 0原文

我正在练习考试,我正在做文字,我想到的是一个要求将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄兵必败 2025-01-22 12:59:32

一个答案是“无效输入”,但不同的答案可能是将输入视为“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文