Skip to content

Add note concerning float sort order #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spec/API_specification/sorting_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ A conforming implementation of the array API standard must provide and support t
- Optional parameters must be [keyword-only](https://www.python.org/dev/peps/pep-3102/) arguments.
- Unless stated otherwise, functions must support the data types defined in {ref}`data-types`.

```{note}
For floating-point input arrays, the sort order of NaNs and signed zeros is unspecified and thus implementation-dependent.

Implementations may choose to sort signed zeros (`-0 < +0`) or may choose to rely solely on value equality (`==`).

Implementations may choose to sort NaNs (e.g., to the end or to the beginning of a returned array) or leave them in-place. Should an implementation sort NaNs, the sorting convention should be clearly documented in the conforming implementation's documentation.

While defining a sort order for IEEE 754 floating-point numbers is recommended in order to facilitate reproducible and consistent sort results, doing so is not currently required by this specification.
```

## Objects in API

<!-- NOTE: please keep the functions in alphabetical order -->
Expand Down