答案 0 :(得分:58)
本文适用于有关此主题的更多信息:http://en.wikipedia.org/wiki/Integer_(computer_science)
所以问题的答案应该是: 从-9,223,372,036,854,775,808到9,223,372,036,854,775,807, 或 - (2 ^ 63)至2 ^ 63 - 1
存储在signed int中的最高正数表示为二进制为
----- 63个-----
0111111111111111111111111111111111111111111111111111111111111111
如果你仔细想想,你会发现这个数字恰好是2 ^ 63 - 1。
答案 1 :(得分:8)
有符号整数的范围从大小为-2 ^(n-1)到2 ^(n-1) - 1,因此在这种情况下,最大值将是2 ^ 63 - 1或9,223,372,036,854,775,807
答案 2 :(得分:0)
Formula
2^(n-1) is the formula of the maximum value of a Bigint data type.
In the preceding formula N is the size of the data type. The ^ operator calculates the power of the value.
Now determine the value of N in Bit:
Select (max_length * 8) as 'Bit(s)' from sys.types Where name = 'BIGInt'
=64 Bits
范围::-9223372036854775808至9223372036854775807