diff options
| -rw-r--r-- | bits.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -50,7 +50,11 @@ int bitXor(int x, int y) { * 1 if x and y have the same sign , 0 otherwise. */ int samesign(int x, int y) { - return 2; + if (!x) + return !y; + if (!y) + return 0; + return !((x ^ y) >> 31); } /* |
