sort-float-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/list-float-en.fab (canonical · concept)#
# Floats use IEEE total order: -0.0 sorts before +0.0, in ascending order.
main {
let list<f64> xs ← [2.5, 0.0, -1.5, -0.0, 1.0, 0.0, -0.0]
print sort via asc from xs
print sort via desc from xs
print xs
}Expected output:
[-1.5, -0.0, -0.0, 0.0, 0.0, 1.0, 2.5]
[2.5, 1.0, 0.0, 0.0, -0.0, -0.0, -1.5]
[2.5, 0.0, -1.5, -0.0, 1.0, 0.0, -0.0]