Bitwise Operators Flashcards
1
Q
Bitwise And operator
A
&
= 1 if each bit is 1
2
Q
What are masks?
A
Hide some bits
3
Q
Bitwise inclusive OR operator
A
|
= 1 if either operand is 1
4
Q
Each bitwise operator has corresponding….
A
Assignment operator
5
Q
Left shift operator
A
«
shifts bits of left operand left by right operand
Vacated bits are 0
6
Q
Right shift operator
A
> > shifts bits of left operator right by number of right operator
7
Q
Vacated bits in signed operators are replaced with….
A
0’s or 1’s
8
Q
Bitwise complement operator
A
~
Inverts bits
9
Q
Why store data in but fields?
A
Reduce storage