Skip to content

Implement IEEE 754 comparisons for floats (#1084) #1090

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

Closed
wants to merge 5 commits into from

Conversation

mbrubeck
Copy link
Contributor

This fixes some important bugs in NaN comparisons (#1083). However, there are some well-known issues with IEEE 754 semantics that we might not want in Rust, so this might not be exactly what we want to do. See #1084 for discussion.

This also uncovered a bug in float::from_str that the tests did not catch before. I commented out the failing test and filed #1089 to fix it.

This is my first real patch to the self-hosted compiler, and I'm still figuring out how things work. Please don't hesitate to tell me if anything could be improved!

Rather than being defined as !positive and !negative, these should act the
same as negative and positive (respectively).  The only effect of this change
should be that all four functions will now return false for NaN.
@mbrubeck
Copy link
Contributor Author

mbrubeck/rust@1f5e47e adds some more isNaN tests.

@brson brson closed this Oct 28, 2011
coastalwhite pushed a commit to coastalwhite/rust that referenced this pull request Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
* Audit for `ptr_guaranteed_<cmp>`

* Update docs

* Add two tests
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

Successfully merging this pull request may close these issues.

2 participants