

Demote float_cmp to pedantic by workingjubilee · Pull Request #7692 · rust-lang/...
source link: https://github.com/rust-lang/rust-clippy/pull/7692
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

See this issue: #7666
This is one of the most frequently suppressed lints. It is deny-by-default. It is not actually clearly wrong, as there are many instances where direct float comparison is actually desirable. It is only after operating on floats that they may lose precision, and that depends greatly on the operation. As most correctness lints have a much higher standard of error, being based on hard and fast binary logic, this should not be amongst them.
A linter is not a substitute for observing the math carefully and running tests, and doing the desirable thing is even more likely to lead one to want exact comparisons.
changelog: Demote [float_cmp
] from correctness to pedantic lints
Recommend
-
14
New issue Add saturating abs/neg #87 Merged ...
-
7
Copy link Contributor workingjubilee...
-
8
Copy link Contributor wchargin...
-
7
Copy link Contributor djc commented
-
5
Copy link Contributor workingjubilee...
-
9
Copy link Contributor workingjubilee ...
-
13
Copy link Contributor workingjubilee...
-
9
DuckDuckGo reverses course, will demote Russian propaganda in search resultsAmrita Khalid·Contributing WriterFri, March 11, 2022, 10:43 A...
-
4
Is "Not intended to be called" any different from "it is UB to be called that way"? If 0 and -1 are the only possible values, the "returns the most significant bit (MSB...
-
7
Conversation Contributor A whil...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK