The ~ unary operator is bitwise negation. If you need fewer bits than what fits in an int then you’ll need to mask it with & after the fact.
The ~ unary operator is bitwise negation. If you need fewer bits than what fits in an int then you’ll need to mask it with & after the fact.