[Numpy-discussion] comparing floating point numbers

Pauli Virtanen pav@iki...
Wed Jul 21 04:11:55 CDT 2010

ke, 2010-07-21 kello 10:46 +0200, David Cournapeau kirjoitti:
[clip: assert nulps]
> I think we should go toward using those almost everywhere we need
> floating point comparison in testing,

I think we also need an assertion function that behaves like np.allclose
-- the ULPs are somewhat unintuitive to work with, and an atol/rtol
combination also gets the job done, so some people might prefer that.
There's `assert_tol_equal` in scipy.special tests that could just be
copied to numpy.testing.


More information about the NumPy-Discussion mailing list