numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
assert_array_max_ulp(a, b, maxulp=1, dtype=None)

Notes

For computing the ULP difference, this API does not differentiate between various representations of NAN (ULP difference between 0x7fc00000 and 0xffc00000 is zero).

Parameters

a, b : array_like

Input arrays to be compared.

maxulp : int, optional

The maximum number of units in the last place that elements of a and b can differ. Default is 1.

dtype : dtype, optional

Data-type to convert a and b to if given. Default is None.

Raises

AssertionError

If one or more elements differ by more than :None:None:`maxulp`.

Returns

ret : ndarray

Array containing number of representable floating point numbers between items in a and b.

Check that all items of arrays differ in at most N Units in the Last Place.

See Also

assert_array_almost_equal_nulp

Compare two arrays relatively to their spacing.

Examples

This example is valid syntax, but we were not able to check execution
>>> a = np.linspace(0., 1., 100)
... res = np.testing.assert_array_max_ulp(a, np.arcsin(np.sin(a)))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.testing._private.utils.assert_array_almost_equal numpy.testing._private.utils.assert_almost_equal numpy.testing._private.utils.assert_array_equal numpy.testing._private.utils.assert_array_almost_equal_nulp numpy.testing._private.utils.assert_allclose numpy.testing._private.utils.assert_approx_equal

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/testing/_private/utils.py#1597
type: <class 'function'>
Commit: