Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // clang -O2 -fno-inline cmp.c
- #include <stdbool.h>
- #include <stdio.h>
- bool
- is_greater(unsigned x, unsigned y)
- {
- return (int)x - (int)y > 0;
- }
- void
- foo(unsigned x, unsigned y)
- {
- printf("%d\n", is_greater(x,y));
- printf("%d\n", (int)x - (int)y > 0);
- printf("%d\n", (int)(x - y) > 0);
- }
- int
- main()
- {
- foo(0x80000001, 0x7fff0000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement