Open
Conversation
the `float-cmp` and `num-traits` libraries don't (yet) support f16. Turns out we didn't really need much from them, just the ulps check. I've adapted the ulps check from miri instead
bfa2fc8 to
eb7cb89
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the
float-cmpandnum-traitslibraries don't (yet) supportf16, and likely won't do so before the type is stabilized.Luckily it turns out that we only really need one function from them for checking whether two floats are "close enough". Miri already has this logic, which I've adapted here.
https://github.com/rust-lang/miri/blob/871d3d06c549cb554dec9a3a7c37cdd723254d06/tests/pass/float.rs#L40-L51
With that we can actually drop the dependency on
float-cmp, which is neat too.