title: Funcion returning an extra 0
body: <p>I have this function which calculates distance between two point, everything works fine but I get an extra zero at the end. </p>
  
  <p>My input:</p>
  
  <pre><code>2  3, 12 30, 40 50, 5  1, 12 10, 3  4
  </code></pre>
  
  <pre><code>float bruteForce(vector&lt; pair &lt;float,float&gt; &gt;::const_iterator brute, vector&lt; pair &lt;float,float&gt; &gt;::const_iterator end, float m)
  {
      float min = FLT_MAX;
  
      for (int i = 0; i &lt; m; i++)  
      {
          for (int j = i+1; j &lt; m; j++)  
          {
              if ( dist(brute[i].first, brute[i].second, brute[j].first, brute[j].second ) &lt; min)  
              {
                  min = dist(brute[i].first, brute[i].second, brute[j].first, brute[j].second); 
                  cout &lt;&lt; min &lt;&lt; endl; 
              }
          }
      }
  
      return min;
  }
  
  
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>1.41421, 
  11.4018, 
  34.4093, 
  0
  </code></pre>