Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
int same_sign = !( (x >> 31) ^ (y >> 31) );
if ( same_sign ) ... else ...