1 2 3 4 5 6 7 8 9 10 11 12 13 14
#define S 31 #define A 17 foo (a) unsigned a; { return (a >> S) & ((1 << A) - 1); } main () { printf ("%d%d\n", foo (-1), foo (0)); }