The range of short integer data in C language is -32768----32767 is in--32768 is how to determine

Source: Internet
Author: User
Short shaping on 32-bit PCs is 2 bytes, each byte is 8 binary bits, a total of 16 bits
16 bits, can represent the number of numbers is 0 ~ 2^16-1, that is 0 ~ 65535 a total of 65,536, if the positive and negative integer each half, That is a negative integer-32768 ~-1, a total of 32,768, 01, positive integer 1 ~ 32767 total 32,767, altogether 65,536.
The short, int , and   long  types all represent integer values with different sizes of storage space. General,  short  type is half machine word length, int  type is one machine length, and   long  type is one or two machine words (in  32  bit machine   INT   Type and   long  types usually have the same word length.   unsigned    int    0~4294967295                     is 2^32-1 int   - 2147483648~2147483647                       is 2^ ( -31)  ~ 2^31-1 unsigned  long  0~4294967295                         is 2^32-1 long   -2147483648~2147483647                      is 2^ ( -31)  ~  2^31-1 long  long Max: 9223372036854775807            is 2^63-1 long  long. The minimum value of:-9223372036854775808           is 2^ ( -63) unsigned  The maximum value of the long  long:18446744073709551615  is the maximum value of the 2^64-1 __int64:9223372036854775807               is the minimum value of 2^63-1 __int64:-9223372036854775808              is 2^ ( -63) unsigned  __int64 The maximum value of:18446744073709551615    is 2^64-1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.