title: What's a good way to add a large number of small floats together?
body: <p>Say you have 100000000 32-bit floating point values in an array, and each of these floats has a value between 0.0 and 1.0. If you tried to sum them all up like this</p>
  
  <pre><code>result = 0.0;
  for (i = 0; i &lt; 100000000; i++) {
      result += array[i];
  }
  </code></pre>
  
  <p>you'd run into problems as <code>result</code> gets much larger than 1.0.</p>
  
  <p>So what are some of the ways to more accurately perform the summation?</p>