Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // clang -O2 -fno-inline cmp.c
  2. #include <stdbool.h>
  3. #include <stdio.h>
  4.  
  5. bool
  6. is_greater(unsigned x, unsigned y)
  7. {
  8. return (int)x - (int)y > 0;
  9. }
  10.  
  11. void
  12. foo(unsigned x, unsigned y)
  13. {
  14. printf("%d\n", is_greater(x,y));
  15. printf("%d\n", (int)x - (int)y > 0);
  16. printf("%d\n", (int)(x - y) > 0);
  17. }
  18.  
  19. int
  20. main()
  21. {
  22. foo(0x80000001, 0x7fff0000);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement