xray.ufuncs.nextafter(*args, **kwargs)

xray specific variant of numpy.nextafter. Handles xray.Dataset, xray.DataArray, xray.Variable, numpy.ndarray and dask.array.Array objects with automatic dispatching.

Documentation from numpy:

nextafter(x1, x2[, out])

Return the next floating-point value after x1 towards x2, element-wise.


x1 : array_like

Values to find the next representable value of.

x2 : array_like

The direction where to look for the next representable value of x1.

out : ndarray, optional

Array into which the output is placed. Its type is preserved and it must be of the right shape to hold the output. See doc.ufuncs.


out : array_like

The next representable values of x1 in the direction of x2.


>>> eps = np.finfo(np.float64).eps
>>> np.nextafter(1, 2) == eps + 1
>>> np.nextafter([1, 2], [2, 1]) == [eps + 1, 2 - eps]
array([ True,  True], dtype=bool)