-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.
Milestone
Description
This RFC proposes adding nextafter
function
Overview
Based on array comparison data, the API is available in most array libraries. The main exception is MXNet which doesn't implement it.
Prior art
- NumPy: https://numpy.org/doc/stable/reference/generated/numpy.nextafter.html#numpy.nextafter
- PyTorch: https://pytorch.org/docs/stable/generated/torch.nextafter.html
- TensorFlow: https://www.tensorflow.org/api_docs/python/tf/math/nextafter
- CuPy: https://docs.cupy.dev/en/stable/reference/generated/cupy.nextafter.html
- Dask: https://docs.dask.org/en/stable/generated/dask.array.nextafter.html
- JAX: https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.nextafter.html
- MXNet doesn't have an implementation for
nextafter
Proposal
This proposal follows similar element-wise APIs,
def nextafter(x1: array, x2: array, /) -> array
Related
- Common APIs across array libraries (1 year later) #187 (comment)
nextafter
is available as part of C99.nextafter
has equivalent APIs in the IEEE 754 specification asnextUp
/nextDown
.- Julia includes
nextfloat
andprevfloat
.
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.
Type
Projects
Status
Stage 1