-
Notifications
You must be signed in to change notification settings - Fork 98
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
Unexpected inequality with large conversion factor #441
Comments
The slight difference in the values is a side effect of normalizing the internal value in meters and floating point imprecision. While Floating point accuracy problems are always a hassle! You can see how Lines 110 to 140 in 629f385
|
Oh, whoops. I was the |
Are you proposing implementing |
Could you expand on why that is the case? Couldn't |
I hadn't thought about the opposite and adding multiple implementations. Similar question though, when should the line be drawn on which external crates should be implemented? |
Where you as the maintainer want it to be drawn from an effort versus convenience perspective. Since the basic set of implementable traits is unaffected, the stakes for answering this are not that high, i.e. you can choose one that you like to provide a convenient path for some users while not blocking anything for others. Of course, just saying no is also a maintainer's prerogative and providing none also does not block anyone from using newtype wrappers. My point basically is that the orphan rules only enforce one thing here: This crate is the only place where we can provide these trait implementations without the additional effort of newtype wrappers. |
With this code:
This test fails:
This also brings to mind that being having a
PartialEq
impl would make itpossibleeasier to use e.g.approx
to compare values.The text was updated successfully, but these errors were encountered: