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));
?
1.4m articles
1.4m replys
5 comments
57.0k users