What is an intuitive way to interpret the bitwise operators and masking? Also, what is masking used for?
问题 I'm learning about bitwise operators and masking right now in my computer systems class. However I'm having some trouble internalizing them. I understand what the operators, &, |, ^, >> (both arithmetic and logical shift), and << DO, but I don't quite get what they're really used for aside from optimizing multiplication and division operations (for >> and <<), and to check if certain bits are on or off (the & operator). Also, I don't understand what masking is used for. I know that doing x &