sort-nan-text-order-en
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Syntax:
Category#
collection
Related#
None.
Examples#
radix/corpus/sort/nan-text-order.fab (canonical · concept)#
# NaNs sort above every number by the IEEE total order, -0.0 before +0.0,
# and text orders by Unicode code point; each list is bound with let.
main {
let list<float> xs ← [2.0, nan, 1.0, -1.0, nan, 0.0]
print sort via asc from xs
print sort via desc from xs
let list<float> ys ← [0.0, -0.0]
print sort via asc from ys
let list<string> ts ← ["b", "É", "a", "B", "", "aa"]
print sort via asc from ts
print sort via desc from ts
}Expected output:
[-1.0, 0.0, 1.0, 2.0, NaN, NaN]
[NaN, NaN, 2.0, 1.0, 0.0, -1.0]
[-0.0, 0.0]
["", "B", "a", "aa", "b", "É"]
["É", "b", "aa", "a", "B", ""]