使用 0x 表示法的数字是什么意思? [英] What do numbers using 0x notation mean?
本文介绍了使用 0x 表示法的数字是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
数字上的0x
前缀是什么意思?
What does a 0x
prefix on a number mean?
const int shared_segment_size = 0x6400;
它来自一个 C 程序.我不记得它的含义,尤其是字母 x
的含义.
It's from a C program. I can't recall what it amounts to and particularly what the letter x
means.
推荐答案
以 0x
开头的文字是十六进制整数.(基数 16)
Literals that start with 0x
are hexadecimal integers. (base 16)
数字0x6400
是25600
.
6 * 16^3 + 4 * 16^2 = 25600
例如,包括字母(也用于十六进制表示法,其中 A = 10,B = 11 ... F = 15)
For an example including letters (also used in hexadecimal notation where A = 10, B = 11 ... F = 15)
数字0x6BF0
是27632
.
6 * 16^3 + 11 * 16^2 + 15 * 16^1 = 27632
24576 + 2816 + 240 = 27632
这篇关于使用 0x 表示法的数字是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文