0x从哪里来?

发布于 2024-10-04 17:12:27 字数 333 浏览 6 评论 0原文

可能的重复:
为什么十六进制前缀为 0x?

我刚刚看到我的一个朋友的评论made:

3x12=36
2x12=24
1x12=12
0x12=18

这让我想知道..
为什么他们选择 0x 作为十六进制数字的前缀?这个决定背后有什么历史吗?

Possible Duplicate:
Why are Hexadecimal Prefixed as 0x?

I just saw a comment a friend of mine made:

3x12=36
2x12=24
1x12=12
0x12=18

Which made me wonder..
Why did they choose 0x as prefix for hexadecimal numbers? Is there any history behind this decision?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

怕倦 2024-10-11 17:12:27

我认为,因为x来自于hex,而0则表示它是一个数字。

I think, because x comes from hex and 0 is to indicate that it is a number.

怼怹恏 2024-10-11 17:12:27

0x 表示该数字可能是十六进制。这适用于 C/C++,也可能适用于其他
语言。

他的评论就是个笑话。他从数字 12 的乘法表开始,但是当他到达 0 时,他暗示 0x 不是“0 乘以...”,而是“十六进制”,因此十六进制的 12 是 18以十进制表示。

0x means the number is probably hexadecimal. This applies in C/C++, and probalby other
languages.

His comment is a joke. he starts with multiplication tables for the number 12, but when he gets to 0 he implies that 0x is not "0 multiplied by...", but instead is "hexadecimal" so 12 in hex is 18 in decimal.

坐在坟头思考人生 2024-10-11 17:12:27

这是来自 WIKIPEDIA 的关于十六进制数字的笑话。

前三个被解释为
乘法,但最后是“0x”
信号的十六进制解释
12,即 18。

It's a joke on HEX numbers from WIKIPEDIA.

The first three are interpreted as
multiplication, but in the last, "0x"
signals Hexadecimal interpretation of
12, which is 18.

稀香 2024-10-11 17:12:27

“0x”表示后面的数字是十六进制的。这是一种明确说明数字是十六进制的方式,并且是 C 编译器和一些汇编器识别的表示法

'0x' means that the number that follows is in hexadecimal. It's a way of unambiguously stating that a number is in hex, and is a notation recognised by C compilers and some assemblers

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