All Questions
Tagged with bitwise-operators language-design
2 questions
1
vote
2
answers
2k
views
In C++, Why do bitwise operators convert 8 or 16 bit integers to 32 bit?
Is there a logical reason why the integer is upgraded to 32+ bits?
I was trying to make an 8bit mask, and found myself a bit disappointed that the upgrade will corrupt my equations.
sizeof( quint8(0)...
73
votes
2
answers
9k
views
Why do bitwise operators have lower priority than comparisons?
Could someone explain the rationale, why in a bunch of most popular languages (see note below) comparison operators (==, !=, <, >, <=, >=) have higher priority than bitwise operators (&, |, ^...