32-bit system left overflow, 64-bit system does not overflow, can the 64-bit system retain 32 left overflow results

Source: Internet
Author: User
32-bit system left overflow, 64-bit system does not overflow, can the 64-bit system retain 32 left overflow results
Echo 83661 <15; // 32 System result:-1553563648


Echo 83661 <15; // 64 system Result: 2741403648


I want to keep the 32 overflow results in the 64-bit system. what can I do? I don't want to understand it.


Reply to discussion (solution)

$ N = 83661 <15; printf ("signed: % d unsigned: % u binary: % 032b", $ n );

Signed:-1553563648 unsigned: 2741403648 binary: 10100011011001101000000000000000

$ N = 83661 <15; printf ("signed: % d unsigned: % u binary: % 032b", $ n );

Signed:-1553563648 unsigned: 2741403648 binary: 10100011011001101000000000000000



Dear user, the task is executed on 64 machines.
$ N = 83661 <15; printf ("% d", $ n); // The result is 2741403648.

Don't you understand?
They are one thing

Don't you understand?
They are one thing



Is it possible to pass
$ N = 83661 <15;
The value is-1553563648 on the 64-bit host.

echo  2741403648 - 0x100000000;
-1553563648

echo  2741403648 - 0x100000000;
-1553563648



Thank you! my problem has been solved.
I am not very familiar with the displacement problem. I have to study this knowledge.

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.