I need to check if two integers are on the same side of zero many times. I don\'t care if it\'s positive or negative, just that it\'s the same side... and performance is very im
final int i = int1 ^ int2;
if (i == 0 && int1 == 0) {
// both are zero
} else if (i & Integer.MIN_VALUE == Integer.MIN_VALUE) {
// signs differ
} else {
// same sign
}