title: When a float variable goes out of the float limits, what happens?
body: <p>I remarked two things:</p>
  
  <ol>
  <li><p><code>std::numeric_limits&lt;float&gt;::max()+(a small number)</code> <strong>gives:</strong> <code>std::numeric_limits&lt;float&gt;::max()</code>.</p></li>
  <li><p><code>std::numeric_limits&lt;float&gt;::max()+(a large number</code> like: <code>std::numeric_limits&lt;float&gt;::max()/3)</code> <strong>gives</strong> inf.</p></li>
  </ol>
  
  <p>Why this difference? Does 1 or 2 results in an OVERFLOW and thus to an undefined behavior?</p>
  
  <p><strong>Edit:</strong> Code for testing this:</p>
  
  <p>1.</p>
  
  <pre><code>float d = std::numeric_limits&lt;float&gt;::max();
  float q = d + 100;
  cout &lt;&lt; "q: " &lt;&lt; q &lt;&lt; endl;
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>float d = std::numeric_limits&lt;float&gt;::max();
  float q = d + (d/3);
  cout &lt;&lt; "q: " &lt;&lt; q &lt;&lt; endl;
  </code></pre>