fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. long x = -9223372036854775808L;
  5. long min = 1L<<63;
  6. long one_fourth = (x>>2)&(min>>1);
  7. printf("%ld, one_fourth\n",one_fourth);
  8. long three_fourth = one_fourth + (one_fourth<<1);
  9. printf("%ld, three_fourth\n",three_fourth);
  10. long remainder = x & (3L);
  11. long add_two = ((long)(!((~remainder)&(3L))))<<1;
  12. long add_one = (!(~remainder & (2L))) & (!((remainder) & (1L)));
  13. three_fourth = three_fourth + add_one + add_two;
  14. printf("%ld, output",three_fourth);
  15. return three_fourth;
  16. }
Success #stdin #stdout 0.01s 5280KB
stdin
66
stdout
-4611686018427387904, one_fourth
4611686018427387904, three_fourth
4611686018427387904, output