title: How to check if a list of floats adds up to a whole number?
body: <p>I would like to find the sum of a list of floats and check if it is a whole number or not:</p>
  
  <pre class="lang-py prettyprint-override"><code>l = [0.85, 0.85, 0.15, 0.15]
  </code></pre>
  
  <p>The sum of <code>l</code> is 2.0, obviously. But Python does not agree, due to <a href="https://stackoverflow.com/questions/588004/is-floating-point-math-broken">floating point limitations</a>:</p>
  
  <pre class="lang-py prettyprint-override"><code>&gt; sum(l)
  1.9999999999999998
  </code></pre>
  
  <p>Therefore my method of choice, <code>sum(l).is_integer()</code>, will return <code>False</code>. </p>
  
  <p>What would be a better method to evaluate if lists sum to a whole number?</p>