c 2b 2b bit shift wrap

Solutions on MaxInterview for c 2b 2b bit shift wrap by the best coders in the world

showing results for - "c 2b 2b bit shift wrap"
Céline
24 Aug 2017
1uint8_t a = 124;
2uint8_t aShifted = leftBitshiftWrap(a,2);
3
4uint8_t leftBitshiftWrap_uint8_t(uint8_t val, uint8_t amt){
5  return (val << amt) | (val >> (8-amt));
6}
Cerys
17 Jun 2017
1//Rotating integers are done as follows
2letter = ((unsigned char)letter >> 1) | (letter << 7);