fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1#![warn(clippy::imprecise_flops)] 2 3fn main() { 4 let x = 3f32; 5 let y = 4f32; 6 let _ = x.hypot(y); 7 let _ = (x + 1f32).hypot(y); 8 let _ = x.hypot(y); 9 // Cases where the lint shouldn't be applied 10 // TODO: linting this adds some complexity, but could be done 11 let _ = x.mul_add(x, y * y).sqrt(); 12 let _ = (x * 4f32 + y * y).sqrt(); 13}