1. Detect if two integers have opposite signs
int x, y; // two integers
bool f=((x^y)<0 ); //true if x and y have opposite signs
http://www-graphics.stanford.edu/~seander/bithacks.html
1. Detect if two integers have opposite signs
int x, y; // two integers
bool f=((x^y)<0 ); //true if x and y have opposite signs
http://www-graphics.stanford.edu/~seander/bithacks.html