title: Using Double.POSITIVE_INFINITY in Java to find minimum value
body: <p>Simple question: will the following code work for finding the minimum value in an array of doubles (assume at least one value exists):</p>
  
  <pre><code>double[] values = ...
  
  double currentMin = Double.POSITIVE_INFINITY;
  
  for(int i = 0; i &lt; values.length; i++) {
      if(values[i] &lt; currentMin) {
          currentMin = values[i];
      }
  }
  
  return currentMin;
  </code></pre>
  
  <p>The crux of the question is whether POSITIVE_INFINITY will behave as expected when compared to other (real) double values, as well as potential infinities themselves.</p>