Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the value range of unsigned int?
What is the value range of unsigned int?
~4294967295(32 bits).

int integer is a basic data type in computer programming language, which usually reflects the most natural length of integers in the machine used. Int integers can be divided into two types: signed and unsigned.

signed types can represent positive numbers, negative numbers or , while unsigned types can only represent values greater than or equal to . By default, all declared integer variables are signed types. If you want to declare unsigned types, you need to add unsigned keyword before the types.

unsigned int in a 16-bit system

In a 16-bit system, an int can store data in the range of-32768 ~ 32767, while an unsigned int can store data in the range of ~65535. Because in the computer, integers are stored in the form of complement. So if the highest bit of an integer is 1, it is a negative number if it has a signed number; If they are unsigned numbers, they all represent positive numbers. In addition, if unsigned omits the last keyword, most compilers will think it is unsigned int