title: Why does '0.2 + 0.1' show as '0.30000000000000004'?
body: <p>I have written the following code for generating a range with floats:</p>
  <pre><code>def drange(start, stop, step):
      result = []
      value = start
      while value &lt;= stop:
          result.append(value)
          value += step
      return result
  </code></pre>
  <p>When calling this function with this statement:</p>
  <pre><code>print drange(0.1,1.0,0.1)
  </code></pre>
  <p>I expected to obtain this:</p>
  <pre><code>[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
  </code></pre>
  <p>But I obtain the following, instead:</p>
  <pre><code>[0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.7999999999999999, 0.8999999999999999, 0.9999999999999999]
  </code></pre>
  <p>Why is this?, and how can I fix it?</p>