Using np.isclose #1

Question Q6.1.7

Why does the following statement evaluate to True even though the two numbers passed to np.isclose() differ by more than atol?

In [x]: np.isclose(-2.00231930436153, -2.0023193043615, atol=1.e-14)
Out[x]: True

Solution

To access solutions, please obtain an access code from Cambridge University Press at the Lecturer Resources page for my book (registration required) and then sign up to scipython.com providing this code.