due to contact with the lower level of data processing to the following use of finishing (reference network)bit arithmeticThe Operation component of a bitwise operation can only be integer or character data, and the bitwise operation considers the
Http://www.cnblogs.com/this-543273659/archive/2011/08/30/2159819.htmlThe two values that participate in the operation, if the two corresponding bit bits are the same, the result is 0, otherwise 1.That0^0 = 0,1^0 = 1,0^1 = 1,1^1 = 03 Features of
bit arithmeticThe operation component of a bitwise operation can only be integer or character data, and the bitwise operation considers the operand as a bit string information composed of binary bits, and completes the specified operation by bit,
Language bitwise operators: With, OR, XOR, reverse, move left, and rightA bitwise operation is a binary-based operation. In system software, it is often necessary to deal with bits problems. The C language provides 6 bit manipulation operators.
Bitwise AND Operator:&
Grammar
Expression
&
expression
NoteAn expression can be another "and" expression, or (follow the type restrictions described below) equality expressions, relational expressions, addition expressions,
In Python:
Bitwise operations, both bitwise operations, are the binary forms of the number of participating operations.
1. With Operation: A and B values are 1 o'clock, A, B and the result of the operation is 1, otherwise 0 (operator:&)
2. Or
Bitwise AND Operator (&)
To participate in the operation of the two data, press bits for the "and" operation.
Operation Rules:0&0=0; 0&1=0; 1&0=0; 1&1=1;
That is: two digits at the same time "1", the result is "1", otherwise 0
For example: 3&5
Bitwise operations are operations that are performed in binary order. In system software, it is often necessary to deal with bits problems. The C language provides 6 bit operator operators. These operators can only be used for integer operands, that
Turn... Bit operations in C #, non-logical ~, Logical and &, logical or |, logical XOR or ^, logical left shift
In C #, we will use in-place operations. For example, to determine whether a number is the power of 2, how to determine whether a
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.