Talk:Integer: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
==Integer size vs. Range== | ==Integer size vs. Range== | ||
In the article, it says that a long has twice the memory and range of a normal int, when the range is actually the square of the int's range (in binary, adding a bit doubles the range). Same for short; its range is the square root of the int's range [[User:Quanta|quanta]] 03:50, 19 January 2010 (UTC) | In the article, it says that a long has twice the memory and range of a normal int, when the range is actually the square of the int's range (in binary, adding a bit doubles the range). Same for short; its range is the square root of the int's range [[User:Quanta|quanta]] 03:50, 19 January 2010 (UTC) | ||
:This article is in fact incorrect.<br /> | |||
:the value range of an integer is -2147483648 - 2147483647<br /> | |||
:the range of a short is -32768 - 32767<br /> | |||
:so the range of an unsigned short is 0 - 65535 (correct explained in the article)<br /> | |||
:but the range of positive values of an unsigned short is still smaller than that one of an signed integer<br /> | |||
:--[[User:Sacaldur|Sacaldur]] |
Revision as of 09:21, 14 May 2011
Integer size vs. Range
In the article, it says that a long has twice the memory and range of a normal int, when the range is actually the square of the int's range (in binary, adding a bit doubles the range). Same for short; its range is the square root of the int's range quanta 03:50, 19 January 2010 (UTC)
- This article is in fact incorrect.
- the value range of an integer is -2147483648 - 2147483647
- the range of a short is -32768 - 32767
- so the range of an unsigned short is 0 - 65535 (correct explained in the article)
- but the range of positive values of an unsigned short is still smaller than that one of an signed integer
- --Sacaldur