title: Python Double Forward Slash Difference from Floor
body: <p>I'm using Python3 and getting different results when using <code>//</code> versus <code>math.floor</code> (other than return types).</p>
  <p>My problem:</p>
  <pre><code>print('Using //: ', 1.0 // 0.2)
  print('Using math.floor: ', math.floor(1.0 / 0.2))
  </code></pre>
  <p>Output:</p>
  <pre><code>Using //:  4.0
  Using math.floor:  5
  </code></pre>
  <p>To me these should return the same results. <a href="https://peps.python.org/pep-0238/" rel="nofollow noreferrer">PEP 238</a> says the following:</p>
  <blockquote>
  <p>Floor division will be implemented in all the Python numeric types, and will have the semantics of: <code>a // b == floor(a/b)</code> except that the result type will be the common type into which a and b are coerced before the operation.</p>
  </blockquote>
  <p>To me, this says that <code>floor(a/b)</code>, when both a and b are floats, should return the same result. (Assuming that math.floor does floor division the same way as discussed in PEP 238). What major aspect of <code>//</code> am I missing that causes these results?</p>
  <p>For system notes, I'm running Python 3.8.5 on MacOS within a virtual environment.</p>
  <p><strong>Edit</strong></p>
  <p>A rounding error might be the culprit, as <code>1.0 // 0.19</code> does return 5.0. However, why is the same error not apparent using math.floor?</p>