Skip to content

Commit f486148

Browse files
committed
add statement that NaN entries in array are not supported
1 parent 817ee30 commit f486148

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/specs/stdlib_selection.md

+8
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Selection of a single value should have runtime of O(`size(array)`), so it is
9595
asymptotically faster than sorting `array` entirely. The test program at the
9696
end of this document shows that is the case.
9797

98+
The code does not support `NaN` elements in `array`; it will run, but there is
99+
no consistent interpretation given to the order of `NaN` entries of `array`
100+
compared to other entries.
101+
98102
`select` was derived from code in the Coretran library by Leon Foks,
99103
https://github.com/leonfoks/coretran. Leon Foks has given permission for the
100104
code here to be released under stdlib's MIT license.
@@ -190,6 +194,10 @@ search.
190194
The partial sorting of `indx` is not stable, i.e., indices that map to equal
191195
values of array may be reordered.
192196

197+
The code does not support `NaN` elements in `array`; it will run, but there is
198+
no consistent interpretation given to the order of `NaN` entries of `array`
199+
compared to other entries.
200+
193201
While it is essential that that `indx` contains a permutation of the integers `1:size(array)`,
194202
the code does not check for this. For example if `size(array) == 4`, then we could have
195203
`indx = [4, 2, 1, 3]` or `indx = [1, 2, 3, 4]`, but not `indx = [2, 1, 2, 4]`. It is the user's

0 commit comments

Comments
 (0)