title: Calculate the maximum value of a Java Double (5)?
body: <p>Calculating this value for an long is easy:</p>
  
  <p>It is simply 2 to the power of n-1, and than minus 1.  n is the number of bits in the type.  For a long this is defined as 64 bits.  Because we must use represent negative numbers as well, we use n-1 instead of n.  Because 0 must be accounted for, we subtract 1.  So the maximum value is:</p>
  
  <pre><code>MAX = 2^(n-1)-1
  </code></pre>
  
  <p>what it the equivalent thought process, for a double:</p>
  
  <pre><code>Double.MAX_VALUE
  </code></pre>
  
  <p>comes to be</p>
  
  <pre><code>1.7976931348623157E308
  </code></pre>