Change implementation of approx_const lint
- Replace epsilon with lower and upper bounds for each constant. - Warn on use of "3.14", and update tests accordingly.
This commit is contained in:
parent
a927bc0b70
commit
546eb14b7e
2 changed files with 30 additions and 23 deletions
|
@ -49,7 +49,8 @@ fn main() {
|
|||
let no_log2_e = 1.442;
|
||||
|
||||
let my_pi = 3.1415; //~ERROR approximate value of `f{32, 64}::PI` found
|
||||
let almost_pi = 3.141;
|
||||
let almost_pi = 3.14; //~ERROR approximate value of `f{32, 64}::PI` found
|
||||
let no_pi = 3.15;
|
||||
|
||||
let my_sq2 = 1.4142; //~ERROR approximate value of `f{32, 64}::SQRT_2` found
|
||||
let no_sq2 = 1.414;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue