Description:
Calculate bitwise XOR on the specified numbers and get the number of 1s in the result’s complement binary.
Syntax:
bit1(x,y)
Note:
The function calculates bitwise XOR on x and y, returns the result, and then gets the number of 1s in the result’s complement binary.
When both x and y are sequences, calculate bitwise XOR on them, return result as a sequence, and then find the total of 1’s in the result sequence’s all members’ complement binaries.
Parameter:
x |
A long integer or a sequence of long integers |
y |
A long integer or a sequence of long integers |
Return value:
Integer
Example:
|
A |
|
1 |
=bit1(6,11) |
Return 3. |
2 |
=[3,5,4] |
|
3 |
=[8,6,7] |
|
4 |
=bit1(A2,A3) |
Return 7. |