Why casting division by zero to integer primitives gives different results? : <pre><code>    System.out.println((byte) (1.0/0));
    System.out.println((short) (1.0/0));
    System.out.println((int) (1.0/0));
    System.out.println((long) (1.0/0));
</code></pre>

<p>The result is:</p>

<pre><code>    -1
    -1
    2147483647
    9223372036854775807
</code></pre>

<p>In binary format:</p>

<pre><code>    1111 1111
    1111 1111 1111 1111
    0111 1111 1111 1111 1111 1111 1111 1111
    0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
</code></pre>

<p>Why casting infinity to int and long integers keeps sign bit as "0", while sets sign bit to "1" for byte and short integers?</p>
