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
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
Range:: -9223372036854775808 to 9223372036854775807
发布评论
评论(3)
本文非常适合了解有关此主题的更多信息: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
存储在有符号 int 中的最大正数表示为二进制
----- 63 个 -----
如果你仔细思考你可以发现这个数字正好是2^63 - 1。
This article is good for more information about this topic: http://en.wikipedia.org/wiki/Integer_(computer_science)
So the answer to the question should be:
From -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807,
or from −(2^63) to 2^63 − 1
The highest positive number stored in a signed int is represented binary as
----- 63 ones -----
If you think carefully you can find out that this number is exactly 2^63 - 1.
有符号整数的大小范围为 −2^(n−1) 到 2^(n−1) − 1,因此在这种情况下最大值将为 2 ^ 63 - 1 或 9,223,372,036,854,775,807
A signed integer ranges from size −2^(n−1) through 2^(n−1) − 1 so in this case the maximum value would be 2 ^ 63 - 1 or 9,223,372,036,854,775,807
范围:: -9223372036854775808 至 9223372036854775807
Range:: -9223372036854775808 to 9223372036854775807