title: Why List<float>.Sum() and manual sum of numbers gives different result in C#?
body: <p>in C# I have following code:</p>
  
  <pre><code>public static float sum(List&lt;float&gt; array)
      {
          float result = 0.0f;
          for (int i = 0; i &lt; array.Length; i++)
              result += array[i];
  
          float lSum = array.Sum();
  
          return result;
      }
  </code></pre>
  
  <p>Why result of those two 'different' approaches differs? </p>
  
  <p>For an array of length <em>911380</em> elements <strong>result</strong>=<em>620246</em> and <strong>lSum</strong>=<em>620235.8</em></p>
  
  <p>What is internal implementation of List.Sum and which answer is correct? Is it problem of C# language/library or does it depends on implementation of <strong>+</strong> in Windows?</p>
  
  <p>We do research about human brain and heart activity and we need correct results, so I appreciate any kind of help! Thanks a lot in advance.</p>