Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
(a ^ b) >= 0
will evaluate to 1 if the sign is the same, 0 otherwise.