/* returns the value of the integer x rotated to the right by n bit * positions */ #define INT_BIT 32 int rightrot(unsigned int x, int n) { return (x >> n) | ((x & ~(~0 << n)) << (INT_BIT-n)); }