_ Int64 usage in C

Source: Internet
Author: User


The int and long ranges are the same and can only be expressed (-2 ^ 31 ~ 2 ^ 31) INTEGER (-2 billion ~ 2 billion)

The range of unsigned int and unsigned long is (0 ~ 2 ^ 32), 4 billion more.

If you want to represent larger integers, these two data types are not easy to use. In ACM, you often need to process such data types. In the past, my stupid method was to create an integer array, each a [I] stores one bit, so that the addition, subtraction, multiplication, division operations must be defined by themselves. I just saw a section on the InternetCodeIt uses _ int64 and 8 bytes to store integers. For more information, seeArticle, The following describes its range and usage:


_ Int64, range (-2 ^ 63 ~ 2 ^ 63), that is, (-92.2 billion million ~ 92.2 billion million)

Unsigned _ int64, range (0 ~ 2 ^ 64), 184.4 billion.

_ Int64 supports four mixed operations and bit operations. Operations of the int type are automatically converted to _ int64.


Input and Output in VC 6.0:

_ Int64:

Scanf ("% i64d", amp; );

Printf ("% i64d", );

Unsigned _ int64

Scanf ("% i64u", amp; );

Printf ("% i64u", );


Input and Output in Dev C:

Long long;

A = 00000000000000000ll

Always add LL


Cout <

Scanf ("% i64d", amp; );

Printf ("% i64d", );


The usage of the symbol is similar.

Related Article

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.