- numpy.nextafter(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'nextafter'>#
Return the next floating-point value after x1 towards x2, element-wise.
Values to find the next representable value of.
The direction where to look for the next representable value of x1. If
x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).
- outndarray, None, or tuple of ndarray and None, optional
- wherearray_like, optional
out=None, locations within it where the condition is False will remain uninitialized.
For other keyword-only arguments, see the ufunc docs.
- outndarray or scalar
The next representable values of x1 in the direction of x2. This is a scalar if both x1 and x2 are scalars.
>>> eps = np.finfo(np.float64).eps >>> np.nextafter(1, 2) == eps + 1 True >>> np.nextafter([1, 2], [2, 1]) == [eps + 1, 2 - eps] array([ True, True])