title: Purpose of defining POSITIVE_INFINITY, NEGATIVE_INFINITY, NaN constants only for floating-point data types, but not for integral data types
body: <p>I want to understand why the <code>POSITIVE_INFINITY</code> and <code>NEGATIVE_INFINITY</code> constants are defined only for floating-point data types (<code>float</code>, <code>double</code> and their wrappers),</p>
  
  <pre><code>public static final float POSITIVE_INFINITY = 1.0f / 0.0f;
  public static final float NEGATIVE_INFINITY = -1.0f / 0.0f;
  </code></pre>
  
  <p>but not for integral data types (<code>byte</code>, <code>short</code>, <code>int</code>, <code>long</code> and their wrappers). This affects the divide operation result on different data types. For example:</p>
  
  <p>For integral types:</p>
  
  <pre><code>int z = 10/0;
  System.out.println(z);
  
  Output:
  Exception in thread "main" java.lang.ArithmeticException: / by zero
  at TesterClass.main(TesterClass.java:16)
  </code></pre>
  
  <p>For floating-point types:</p>
  
  <pre><code>double z = 10/0.0;
  System.out.println(z);
  
  Output:
  Infinity
  </code></pre>