Unsigned
Unsigned Integers
If you know an integer will always be positive then you can double the range of the positive value limit as the negative value limit will be reduced to zero in favor of expanding the positive limit.
Declaration | Size | Supported number range | Standard-defined minimum size |
---|---|---|---|
unsigned char myVar; | 8 bits | 0 to 255 | 8 bits |
unsigned short myVar; | 16 bits | 0 to 65,535 | 16 bits |
unsigned long myVar; | 32 bits | 0 to 4,294,967,295 | 32 bits |
unsigned long long myVar; | 64 bits | 0 to 184,467,440,737,095,551,615 | 64 bits |
unsigned int myVar; | 32 bits | 0 to 4,294,967,295 | 16 bits |