Followup: Check if two integers have the same sign
<p>I experimented with the bitwise-operator suggested <a href="http://stackoverflow.com/questions/10298109/check-if-two-integers-have-the-same-sign">to my question</a> and <a href="http://stackoverflow.com/a/66968/1047823">here</a>.</p>

<p>Check the results of my testsuite:</p>

<pre><code>function equal(n1,n2){
    var bool = (n1^n2 &gt;= 0)?true:false;
    document.write("&lt;div&gt;"+bool+" ("+(n1^n2)+")&lt;/div&gt;");
}


equal(-5,-2);  //true
equal(-4,-20); //true
equal(15,-2);  //false
equal(25,3);   //true 

equal(-1,1);   //false
equal(1,1);    //true
equal(-1,-1);  //true

// edgecases
equal(0,0);
equal(-0,0);
equal(+0,0);
equal(-0,+0);
equal(+0,-0);
</code></pre>

<p>outcome:</p>

<pre><code>true (5)
true (16)
true (-15)
true (26)

true (-2)
false (0)
true (0)

true (0)
true (0)
true (0)
true (0)
true (0)
</code></pre>

<p>My according <a href="http://jsfiddle.net/qSwFt/" rel="nofollow">fiddle is here</a>.</p>

<p>The result confuses me very much. Am I too stupid? What has happened here?</p>
