mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-11 07:34:18 +00:00
Add tests for zero exponents in excessive_precision
This commit is contained in:
parent
42f2304ce4
commit
e476d05c8f
3 changed files with 13 additions and 1 deletions
|
@ -63,4 +63,7 @@ fn main() {
|
|||
|
||||
// issue #7744
|
||||
let _ = 2.225_073_858_507_201e-308_f64;
|
||||
|
||||
// issue #7745
|
||||
let _ = 0_f64;
|
||||
}
|
||||
|
|
|
@ -63,4 +63,7 @@ fn main() {
|
|||
|
||||
// issue #7744
|
||||
let _ = 2.225_073_858_507_201_1e-308_f64;
|
||||
|
||||
// issue #7745
|
||||
let _ = 1.000_000_000_000_001e-324_f64;
|
||||
}
|
||||
|
|
|
@ -84,5 +84,11 @@ error: float has excessive precision
|
|||
LL | let _ = 2.225_073_858_507_201_1e-308_f64;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `2.225_073_858_507_201e-308_f64`
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
error: float has excessive precision
|
||||
--> $DIR/excessive_precision.rs:68:13
|
||||
|
|
||||
LL | let _ = 1.000_000_000_000_001e-324_f64;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0_f64`
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue