I\'d like to write a function, in C, which takes the MSB of uint8_t, and if it\'s set, returns 0xFF and if not 0x00. In short, which retur
uint8_t
0xFF
0x00
What about
- (x >> 7)
?
Only the MSB is retained and math negation is used to replicate it to all bits.