Check that all items of arrays differ in at most N Units in the Last Place.
Input arrays to be compared.
The maximum number of units in the last place that elements of a and b can differ. Default is 1.
Data-type to convert a and b to if given. Default is None.
Array containing number of representable floating point numbers between items in a and b.
If one or more elements differ by more than maxulp.
See also
assert_array_almost_equal_nulpCompare two arrays relatively to their spacing.
For computing the ULP difference, this API does not differentiate between various representations of NAN (ULP difference between 0x7fc00000 and 0xffc00000 is zero).
>>> a = np.linspace(0., 1., 100) >>> res = np.testing.assert_array_max_ulp(a, np.arcsin(np.sin(a)))
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.testing.assert_array_max_ulp.html