RosettaCodeData/Task/Bitwise-operations/C/bitwise-operations-2.c

6 lines
126 B
C
Raw Permalink Normal View History

2013-04-10 16:19:29 -07:00
/* rotate x to the right by s bits */
unsigned int rotr(unsigned int x, unsigned int s)
{
return (x >> s) | (x << 32 - s);
}