title: Finding min and max elements in a float array using out params
body: <p>I have written the function below:</p>
  
  <pre><code>void find_minmax_float(float * begin, float * end, 
                  float ** min, float ** max) {
      if(begin == end) { //if it is not an array
          *min = *max = 0;
      } else { //if atleast 1 element exist
          *min = *max = begin;
          while(++begin != end) {
              if(*begin &lt; ** min) *min = begin;
              if(*begin &gt; ** max) *max = begin;
          }
      }
  }
  </code></pre>
  
  <p>And I test it with the following code:</p>
  
  <pre><code>float floats[] = { 0.9, 1.11, 2.35, 5.999 };
  int size = sizeof(floats) / sizeof(floats[0]);
  float * fmin;
  float * fmax;
  
  find_minmax_float(floats, floats + size, &amp;fmin, &amp;fmax);
  printf("float[]\tmin=%f\tmax=%f\n", *fmin, *fmax);
  </code></pre>
  
  <p>But I get this weird output on terminal:</p>
  
  <pre><code>float[] min=0.000000    max=5.999000
  </code></pre>
  
  <p>Obviously I get the <code>min</code> value not correct, while the <code>max</code> seems to be ok. I can not figure out what is going wrong! I should get <code>min=0.900000</code></p>
  
  <p>I tried 0.1 to 0.9 and I always get 0.000000 for the min.</p>