Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

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

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]