numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
nulp_diff(x, y, 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

x : array_like

first input array

y : array_like

second input array

dtype : dtype, optional

Data-type to convert x and y to if given. Default is None.

Returns

nulp : array_like

number of representable floating point numbers between each item in x and y.

For each item in x and y, return the number of representable floating points between them.

Examples

# By definition, epsilon is the smallest number such as 1 + eps != 1, so # there should be exactly one ULP between 1 and 1 + eps >>> nulp_diff(1, 1 + np.finfo(x.dtype).eps) 1.0

See :

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#1649
type: <class 'function'>
Commit: