15 ms·
I believe 0x80 is 0b1000000
by RegEx 13y ago
I believe 0x80 is 0b1000000
- Hytosys 13y agoOops, did everything in decimal. Good point and correction. Still, the difference in legibility and implications of the two lines of code are important. Modern compilers would optimize ((foo & 0x80) == 0x80) to (foo & 0x80) but leave ((foo & 0x60) == 0x60) alone because it is testing more than one bit.