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

float_cmp should be okay when comparing with zero #165

Closed
Manishearth opened this issue Aug 13, 2015 · 6 comments · Fixed by #191
Closed

float_cmp should be okay when comparing with zero #165

Manishearth opened this issue Aug 13, 2015 · 6 comments · Fixed by #191
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy

Comments

@Manishearth
Copy link
Member

== 0 or 0 == are okay, but other numbers have a chance of imprecision.

@Manishearth Manishearth added good-first-issue These issues are a good way to get started with Clippy C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Aug 13, 2015
@birkenfeld
Copy link
Contributor

👍

@terrynsun
Copy link

Are you working on this or just endorsing it? (I'd like to try it if you aren't.)

@llogiq
Copy link
Contributor

llogiq commented Aug 14, 2015

I think it's just an endorsement. He would have been finished by now had he decided to work on it. 😄

@birkenfeld
Copy link
Contributor

😄 go ahead! @llogiq this may be good to base on the constant folding branch?

@llogiq
Copy link
Contributor

llogiq commented Aug 14, 2015

It would certainly be helpful. I shall add a .as_float(&self) -> Option<f64> function to Constant.

@Manishearth
Copy link
Member Author

@terrynsun go ahead! don't worry about constant folding for now -- we should do that once that branch lands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants