Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does unsigned integer mean?
What does unsigned integer mean?
There are two types of integers: unsigned and signed. By default, all declared integer variables are signed types (char is a bit special). If you want to declare an unsigned type, you need to add the unsigned before the type. The difference between an unsigned integer and a signed integer is that an unsigned type can store twice as many positive numbers as a signed integer, because a signed type stores most significant bit, while an unsigned type stores all numbers. For example, in a 16 bit system, int can store data in the range of -32768~32767, while unsigned can store data in the range of 0~65535. When a negative value cannot be taken, it can be defined as unsigned, and the data in some underlying embedded programming are generally unsigned.

Unsigned integer and signed integer operations are determined according to the maximum value of data (this is also the characteristic of mixed data type operations in computers. For two different types of data operations, the type that can represent larger data will be used as the operation type). These two data operations first convert signed integers into unsigned integers, and then calculate them through unsigned number operation rules. If the data is beyond the range of integer data representation, it is represented by the smallest data type greater than the current data type.