if ($x<0 == $y<0) { print "$x and $y have the same sign"; }