Commit Diff
--- 2-8.c +++ 2-8.c @@ -50,7 +50,7 @@ unsigned invert(unsigned x, int p, int n) { /* rightrot(x,n): returns x rotated to the right by n bits */ unsigned rightrot(unsigned x, int n) { - return ((x & ~(~0<<n)) << (sizeof(unsigned)*8-n)) | ((x & (~0<<n)) >> n); + return ((x & ~(~0<<n)) << (sizeof(unsigned)*8-n)) | (x >> n); } /*
