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

Lint float loops #758

Closed
llogiq opened this issue Mar 12, 2016 · 3 comments · Fixed by #12765
Closed

Lint float loops #758

llogiq opened this issue Mar 12, 2016 · 3 comments · Fixed by #12765
Assignees
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-correctness Lint: Belongs in the correctness lint group L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types

Comments

@llogiq
Copy link
Contributor

llogiq commented Mar 12, 2016

those are usually better written as integer-y loops + cast within the loop

Note that this is mostly about while loops.

@oli-obk oli-obk added L-correctness Lint: Belongs in the correctness lint group L-style Lint: Belongs in the style lint group good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints T-middle Type: Probably requires verifiying types labels May 10, 2017
@cauebs
Copy link
Contributor

cauebs commented Nov 1, 2020

Why do you say it's better? Because that way it won't accumulate the error over successive operations?

Is that always better? The code might get a bit uglier, and precision might not matter much.

@llogiq
Copy link
Contributor Author

llogiq commented Nov 28, 2020

Yes, errors might compound.

@yusufraji
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-correctness Lint: Belongs in the correctness lint group L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants