1

I have two numbers –

3.125000 Mbytes and 2.954880 Mbytes.

I want to compare them and it should return True since they are almost 3Mbytes. How can I do so in Python3.

I tried doing math.isclose(3.125000,2.954880, abs_tol=0.1).

However, this returns False. I really don’t understand how to put tolerance here.

math.isclose(3.125000,2.954880,  abs_tol=0.1). 

https://docs.python.org/3/library/math.html

math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)

I am using Python 3.5.2.

The expected result is True.
The actual result is False.