fork(3) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. size_t a = 0x80000000;
  5. int b = 0x80000000;
  6. int c = 0x1;
  7.  
  8. printf("a = %u\n", a);
  9. printf("b = %d\n", b);
  10. printf("c = %d\n", c);
  11. printf("\n");
  12.  
  13. printf("%d : %u >> 32 // ", (a >> 32),a);printf("0x%x\n", (a >> 32));
  14. printf("%d : %u >> 31 // ", (a >> 31),a);printf("0x%x\n", (a >> 31));
  15. printf("%d : %u >> 30 // ", (a >> 30),a);printf("0x%x\n", (a >> 30));
  16.  
  17. printf("%d : %d >> 32 // ", (b >> 32),b);printf("0x%x\n", (b >> 32));
  18. printf("%d : %d >> 31 // ", (b >> 31),b);printf("0x%x\n", (b >> 31));
  19. printf("%d : %d >> 30 // ", (b >> 30),b);printf("0x%x\n", (b >> 30));
  20.  
  21. printf("%d : %d >> 1\n", (c >> 1),c);
  22. return 0;
  23. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
a = 2147483648
b = -2147483648
c = 1

0   : 2147483648 >> 32 // 0x0
1   : 2147483648 >> 31 // 0x1
2   : 2147483648 >> 30 // 0x2
-1   : -2147483648 >> 32 // 0xffffffff
-1   : -2147483648 >> 31 // 0xffffffff
-2   : -2147483648 >> 30 // 0xfffffffe
0   : 1 >> 1