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

Add Add trait implementation to OrderedFloat? #62

Closed
tiby312 opened this issue Aug 3, 2019 · 2 comments
Closed

Add Add trait implementation to OrderedFloat? #62

tiby312 opened this issue Aug 3, 2019 · 2 comments

Comments

@tiby312
Copy link

tiby312 commented Aug 3, 2019

This way you could pass an ordered float to a generic function that requires Add+Ord. Same question for Sub/Mul/Div.

@tiby312
Copy link
Author

tiby312 commented Aug 5, 2019

If I have a computation heavy generic math function that requires Ord, I would rather pass it an OrderedFloat instead of a NotNan since NotNan adds overhead to each computation, unlike OrderedFloat which only incurrs overhead on comparisons.

@martinellison
Copy link

The pathfinding crate requires at least num_traits::identities::Zero and OrderedFloat does not implement this. Actually, there are several more traits in num_traits that might be useful to someone.

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

No branches or pull requests

3 participants