Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choose float sort #29

Open
gjaegle opened this issue Jul 4, 2017 · 1 comment
Open

choose float sort #29

gjaegle opened this issue Jul 4, 2017 · 1 comment

Comments

@gjaegle
Copy link

gjaegle commented Jul 4, 2017

in my particular project, i need both increasing sort and decreasing sort.

could you please detail how i could specialize the order to reverse the default increasing sort?

or should i clone your library to duplicate the methods & structure of OrderedFloat.

@optozorax
Copy link

@gjaegle

let arr = vec![1.0, 2.0, 3.0].into_iter().map(|x| NotNan::new(x).unwrap());
arr.sort_by_key(|x| std::cmp::Reverse(x));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants