Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language short integer data range -32768-32767 medium. -How is 32768 determined?
C language short integer data range -32768-32767 medium. -How is 32768 determined?
Short occupies 2 bytes of memory space, that is, 16 binary bits.

When representing a negative number, the highest bit is the sign bit (the sign bit of a negative number is 1), and the smallest negative number is100000000000. However, in a computer, negative numbers are represented by the complement (the sign bit is unchanged, the rest bits are inverted, and 1 is added), which is specified as 100000000.

When representing positive numbers, the highest bit is the sign bit (the sign bit of positive numbers is 0), and the largest positive number is 011111165438.