title: What are the INFINITY constants in Java, really?
body: <p>I just recently ran across the constants in the primitive type wrapper classes like <code>Double.POSITIVE_INFINITY</code> and <code>Double.NEGATIVE_INFINITY</code>.  In the API, it defines the first as:</p>
  
  <blockquote>
    <p>A constant holding the positive infinity of type double. It is equal to the value returned by Double.longBitsToDouble(0x7ff0000000000000L).</p>
  </blockquote>
  
  <p>The others have definitions along these same lines.</p>
  
  <p>What I'm having trouble with is understanding <em>what</em> these constants actually are.  They can't actually <em>be</em> or <em>represent</em> positive/negative infinities, because the system is by nature finite.  Is it just some arbitrary setting of bits which the Java creators deemed would define the concept of infinity?  Or do these actually have some kind of special value?  If it <em>is</em> just an arbitrary string of bits interpreted as a <code>double</code>, then is there some normal number out there that, when interpreted as a <code>double</code> will return <code>POSITIVE_INFINITY</code> instead of whatever value is actually expected?</p>
  
  <p>Forgive me if the answer to this is obvious given the <code>Double.longBitsToDouble(0x7ff0000000000000L)</code> part of the API.  Truthfully, that description is pretty arcane to me and I won't pretend to understand what the hexadecimal values actually mean or represent.</p>