title: Why does numeric_limits::min return a negative value for int but positive values for float/double?
body: <p><strong>Why</strong> does numeric_limits::min return a negative value for int, but positive values for e.g. float and double?</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;limits&gt;
  
  using namespace std;
  
  int main() {
    cout &lt;&lt; "int: " &lt;&lt; numeric_limits&lt;int&gt;::min() &lt;&lt; " "
         &lt;&lt; "float: " &lt;&lt; numeric_limits&lt;float&gt;::min() &lt;&lt; " "
         &lt;&lt; "double: " &lt;&lt; numeric_limits&lt;double&gt;::min() &lt;&lt; "\n";
    return 0;
  }
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>int: -2147483648 float: 1.17549e-38 double: 2.22507e-308
  </code></pre>
  
  <p><strong>From cppreference:</strong></p>
  
  <blockquote>
    <p>Returns the minimum finite value representable by the numeric type T.</p>
    
    <p>For floating-point types with denormalization, min returns the minimum
    positive normalized value. <em>Note that this behavior may be unexpected</em>,
    especially when compared to the behavior of min for integral types. To
    find the value that has no values less than it, use
    <code>numeric_limits::lowest</code>. </p>
    
    <p>min is only meaningful for bounded types and
    for unbounded unsigned types, that is, types that represent an
    infinite set of negative values have no meaningful minimum.</p>
  </blockquote>