That's called a mask. Which is what I said to and with first. But you might not want to write out manually numbers like this and it would be easier to simply shift one number or the other. 1 << 2 & var is just as valid. It depends on both your preference and use case and produces the same exact result.
View all comments
Show parent comment
3
u/serge-mv Oct 08 '26
That's called a mask. Which is what I said to and with first. But you might not want to write out manually numbers like this and it would be easier to simply shift one number or the other. 1 << 2 & var is just as valid. It depends on both your preference and use case and produces the same exact result.