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

fix suggestion for floating point inequality #4214

Merged
merged 1 commit into from
Jun 17, 2019
Merged

fix suggestion for floating point inequality #4214

merged 1 commit into from
Jun 17, 2019

Conversation

danieledapo
Copy link
Contributor

@danieledapo danieledapo commented Jun 17, 2019

It should be of the form (a - b).abs() > error whereas it was (a - b).abs() < error that is instead what should be used for equality.

fixes #4204.

changelog: fix suggestion for floating point inequality

It should be of the form `(a - b).abs() > error` whereas it was
`(a - b).abs() < error` that is instead what should be used for equality.
@flip1995
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 17, 2019

📌 Commit be14ea8 has been approved by flip1995

bors added a commit that referenced this pull request Jun 17, 2019
fix suggestion for floating point inequality

It should be of the form `(a - b).abs() > error` whereas it was `(a - b).abs() < error` that is instead what should be used for equality.

fixes #4204.

changelog: fix suggestion for floating point inequality
@bors
Copy link
Contributor

bors commented Jun 17, 2019

⌛ Testing commit be14ea8 with merge ab085d9...

@bors
Copy link
Contributor

bors commented Jun 17, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing ab085d9 to master...

@bors bors merged commit be14ea8 into rust-lang:master Jun 17, 2019
@danieledapo danieledapo deleted the 4204-fix-float-cmp-neq branch June 17, 2019 15:56
@danieledapo
Copy link
Contributor Author

danieledapo commented Jun 17, 2019

thanks for merging the PR so quickly! 🎉

@flip1995
Copy link
Member

Thanks for fixing this issue so quickly! :)

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.

The suggested fix for comparing floats with != is incorrect
3 participants