fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4.  
  5. int isGreater(uint32_t x, uint32_t y)
  6. {
  7. y = ~y;
  8. return !(((x&y) + ((x^y) >> 1)) >> 31);
  9. }
  10.  
  11. int main(void) {
  12. printf("%d %d %d\n", isGreater(1, 1), isGreater(1, 0), isGreater(0,1));
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
1 0 1