title: How to evaluate whether two number are close enough or not in Python?
body: <p>I have two numbers - </p>
  
  <p>3.125000 Mbytes and 2.954880 Mbytes.</p>
  
  <p>I want to compare them and it should return True since they are almost 3Mbytes. How can I do so in Python3.</p>
  
  <p>I tried doing <code>math.isclose(3.125000,2.954880,  abs_tol=0.1)</code>. </p>
  
  <p>However, this returns <code>False</code>. I really don't understand how to put tolerance here. </p>
  
  <pre><code>math.isclose(3.125000,2.954880,  abs_tol=0.1). 
  </code></pre>
  
  <p><a href="https://docs.python.org/3/library/math.html" rel="nofollow noreferrer">https://docs.python.org/3/library/math.html</a></p>
  
  <pre><code>math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)
  </code></pre>
  
  <p>I am using Python 3.5.2.</p>
  
  <p>The expected result is <code>True</code>.
  The actual result is <code>False</code>.</p>