Logical operation and displacement operation

Source: Internet
Author: User
XOR or operation
True⊕false = True
False⊕true = True
False⊕false = False
True⊕true = False
Same OR operation
True⊙false = False
False⊙true = False
False⊙false = Ture
True⊙true = Ture
or arithmetic
True | | False = True
False | | True = True
False | | False = False
True | | True = True
and arithmetic
True && false = False
False && True = False
False && false = False
True && true = True
Non-operational
┐true = False
┐false = True


Displacement operations
Shift Left: 2<<2 = 8
Shift Right: 8>>2 = 2
Move right one equivalent to 2, right shift n is equivalent to dividing by 2 N-Squared
On the premise that the number is not overflow, for positive and negative numbers, the left one is the equivalent of multiplying by 2 by 1, and the left shift n is the equivalent of multiplying by 2 of the n-th square.

Logical operation and displacement operation

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.