Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the range of int2 int4 int8 int? How to calculate?
What is the range of int2 int4 int8 int? How to calculate?
Int2 is a 2-byte signed integer, the sign occupies 1 bit, and the remaining 15 bits of binary digits represent numerical values. The largest positive number is 0x7fff.

Int4 is a 4-byte signed integer symbol, 1 bit, and the remaining 3 1 bit represents a numerical value. The largest positive number is 0x7fffffff.

Int8 is an 8-byte signed integer symbol, accounting for 1 bit, and the remaining 63 binary bits represent numerical values.

The largest positive number is 0x7ffffffffff.

(I don't need to go into details about the conversion from 16 to 10. )

Int is equal to int4 or int8 or int 2, which depends on the kind of compiler. int4 is generally used.

The detailed range of values is in the header file limits.h

Integer 2 range SHRT minimum, SHRT maximum (-32768, +32767)

The range of Int4 is LONG_MIN and long _ max (-2147483648+2147483647).

Int8 can use LONG_LONG or. . . (depending on compiler type)