2 ms·You can use the ordered_float crate. It has a newtype that cannot hold NaNs and thus impls Ord.by Arnavion 7y agoYou can use the ordered_float crate. It has a newtype that cannot hold NaNs and thus impls Ord.