可以存储在 dword 类型的变量中的以 16 为底的最大整数是多少? [英] What is the largest integer number base 16 that can be store in a variable of type dword?
问题描述
它可以存储的最大数量是多少?
What's the largest number it can store?
更重要的是,有人可以解释为什么dword不能存储更大的数字吗?
More importantly, could someone explain why dword can't store a larger number?
推荐答案
与本身使用的基础无关.DWORD可存储的最大数目受以下事实的限制:DWORD(至少在DWORD的典型用法中,这是Microsoft typedef)是32位宽的无符号整数.这意味着它可以存储的最大数量是2 ^ 32-1.
It has nothing to do with the base used per se. The largest number a DWORD can store is constrained by the fact that DWORD (at least in typical usage of DWORD, which is a Microsoft typedef) is a 32 bit wide unsigned integer. That means the largest number it can store is 2^32-1.
- 二进制文件中的
11111111111111111111111111111111111
. - 用十六进制表示的是
0xFFFFFFFF
,如@GregHewgill所说. - 以小数表示的是
4294967295
. - 八进制表示为
37777777777
.
- In binary that's
11111111111111111111111111111111
. - In hex it's
0xFFFFFFFF,
as @GregHewgill said. - In Decimal that's
4294967295
. - In octal that's
37777777777
.
这些数字是相同的,只是使用了不同的底数.二进制显示了计算机级别上真正发生的事情.DWORD的最大值(32位宽)将所有32位都打开.
Those are the same number just using different bases. Binary shows what's truly going on at a machine level. Maximum value of DWORD, which is 32 bits wide, has all 32 bits on.
这篇关于可以存储在 dword 类型的变量中的以 16 为底的最大整数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!