Skip to main content

sort_order

Function sort_order 

Source
pub fn sort_order<T>(a: T, b: T) -> Ordering
where T: Element,
Expand description

The order of lax.sort keys: integers and booleans in their natural order, and floats in the total order -inf < ... < 0 < ... < inf < NaN in which -0.0 equals 0.0 and all NaNs are equal, as JAX’s comparator makes it by canonicalizing zeros and NaNs before a total-order comparison.

Complex numbers order lexicographically by their real and imaginary parts, each in the order of floats, as JAX’s comparator splits them into two keys.