Add tests for zero exponents in excessive_precision

This commit is contained in:
dswij 2021-10-06 15:33:05 +08:00
parent 42f2304ce4
commit e476d05c8f
3 changed files with 13 additions and 1 deletions

View file

@ -63,4 +63,7 @@ fn main() {
// issue #7744
let _ = 2.225_073_858_507_201e-308_f64;
// issue #7745
let _ = 0_f64;
}

View file

@ -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;
}

View file

@ -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