I have a simple understanding of the concepts of original code, inverse code, and complement code
But when I encountered the bitwise "AND, OR, NOT", I almost exploded on the spot~
When you move left and right, you just pull out your hair~~~
Can anyone give a brief summary?
These are just appetizers. They must not be regarded as obstacles. Spending money will reduce your interest in learning PHP. If you don’t understand the basic knowledge, you can skip it first. When you use it, consider it based on the actual situation.
Logical AND, logical OR, and logical negation are worthy operations on boolean and belong to the category of discrete mathematics.
Bitwise AND, bitwise OR, and bitwise NOT are operations on computer bits and belong to the category of computer binary bit operations.
Logical and are both true and true. The difference between & and && in c.
Logical or If true, it is true. The difference between | and || in c.
Logical Not False
(2) XOR with 0, retain the original value, X ^ 0000 0000 = 1010 1110.
Exchange a and b
Method 1 Method 2
##1.a=a^b 1.a= a-b 2.b=b^a 2.b= a b 3.a=a^b 3.a= b-a Left shift operator (<< ) Shift all the binary bits of an operand to the left by a certain number of bits (the two bits on the left