title: Why does Release/Debug have a different result for std::min?
body: <p>Here is the test program:</p>
  
  <pre><code>void testFunc()
  {
      double maxValue = DBL_MAX;
      double slope = std::numeric_limits&lt;double&gt;::quiet_NaN();
  
      std::cout &lt;&lt; "slope is " &lt;&lt; slope &lt;&lt; std::endl;
      std::cout &lt;&lt; "maxThreshold is " &lt;&lt; maxValue &lt;&lt; std::endl;
      std::cout &lt;&lt; "the_min is " &lt;&lt; std::min( slope, maxValue) &lt;&lt; std::endl;
      std::cout &lt;&lt; "the_min is " &lt;&lt; std::min( DBL_MAX, std::numeric_limits&lt;double&gt;::quiet_NaN()) &lt;&lt; std::endl;
  }
  
  int main( int argc, char* argv[] )
  {
      testFunc();
      return 0;
  }
  </code></pre>
  
  <p>In Debug, I get:</p>
  
  <pre><code>slope is nan
  maxThreshold is 1.79769e+308
  the_min is nan
  the_min is 1.79769e+308
  </code></pre>
  
  <p>In Release, I get:</p>
  
  <pre><code>slope is nan
  maxThreshold is 1.79769e+308
  the_min is 1.79769e+308
  the_min is nan
  </code></pre>
  
  <p>Why would I get a different result in Release than Debug?</p>
  
  <p>I already checked Stack Overflow post <em><a href="https://stackoverflow.com/questions/1632145/use-of-min-and-max-functions-in-c">Use of min and max functions in C++</a></em>, and it  does not mention any Release/Debug differences.</p>
  
  <p>I am using Visual Studio 2015.</p>