Skip to content

Commit 4057a88

Browse files
committed
Add notes concerning complex number support to sorting functions
1 parent 7d05312 commit 4057a88

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/API_specification/array_api/sorting_functions.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ def argsort(x: array, /, *, axis: int = -1, descending: bool = False, stable: bo
44
"""
55
Returns the indices that sort an array ``x`` along a specified axis.
66
7+
.. note::
8+
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
9+
710
Parameters
811
----------
912
x : array
10-
input array.
13+
input array. Should have a real-valued data type.
1114
axis: int
1215
axis along which to sort. If set to ``-1``, the function must sort along the last axis. Default: ``-1``.
1316
descending: bool
@@ -25,10 +28,13 @@ def sort(x: array, /, *, axis: int = -1, descending: bool = False, stable: bool
2528
"""
2629
Returns a sorted copy of an input array ``x``.
2730
31+
.. note::
32+
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
33+
2834
Parameters
2935
----------
3036
x: array
31-
input array.
37+
input array. Should have a real-valued data type.
3238
axis: int
3339
axis along which to sort. If set to ``-1``, the function must sort along the last axis. Default: ``-1``.
3440
descending: bool

0 commit comments

Comments
 (0)