Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
What's wrong with
return ((x<0) == (y<0));
?
2.1m questions
2.1m answers
60 comments
57.0k users