Simplest way to check if two integers have same sign

bit-manipulationintegersign

Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?

Best Answer

What's wrong with

return ((x<0) == (y<0));  

?