PHP bit Operation vs. XOR or negation

Source: Internet
Author: User

* Complement of 13&7 13 00000000 00000000 00000000 00001101 7 00000000 00000000 00000000 00000111 13&7 00000000 00000000 0 0000000 00000101 = 5 5|4 5 Complement 00000000 00000000 00000000 00000101 4 Complement 00000000 00000000 00000000 00000100 5|4 00000000 00 000000 00000000 000000101 =5-3^3-3 's complement-3 of the original code 10000000 00000000 00000000 00000011-3 Anti-code 11111111 11111111 11111111 1111110 0-3 complement 11111111 11111111 11111111 11111101 3 Complement 00000000 00000000 00000000 00000011-3^3 11111111 11111111 11111111 11111 110 "complement" push anti-code "to complement-1" 11111111 11111111 11111111 11111101 "anti-code" push the original code "symbol bit invariant other inversion" 10000000 00000000 00000000 00000010 "original Code" =-2 Note: Because binary does not have carry and abdication, can be regarded as 10-1, that is equal to 1
*

PHP bit Operation vs. XOR or negation

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.