]> git.lizzy.rs Git - rust.git/blob - tests/ui/floating_point_powi.stderr
Lint (x * x + y * y).sqrt() => x.hypot(y)
[rust.git] / tests / ui / floating_point_powi.stderr
1 error: square can be computed more accurately
2   --> $DIR/floating_point_powi.rs:7:13
3    |
4 LL |     let _ = x.powi(2);
5    |             ^^^^^^^^^ help: consider using: `x * x`
6    |
7    = note: `-D clippy::imprecise-flops` implied by `-D warnings`
8
9 error: square can be computed more accurately
10   --> $DIR/floating_point_powi.rs:8:13
11    |
12 LL |     let _ = x.powi(1 + 1);
13    |             ^^^^^^^^^^^^^ help: consider using: `x * x`
14
15 error: square can be computed more accurately
16   --> $DIR/floating_point_powi.rs:11:14
17    |
18 LL |     let _ = (x.powi(2) + y).sqrt();
19    |              ^^^^^^^^^ help: consider using: `x * x`
20
21 error: square can be computed more accurately
22   --> $DIR/floating_point_powi.rs:12:18
23    |
24 LL |     let _ = (x + y.powi(2)).sqrt();
25    |                  ^^^^^^^^^ help: consider using: `y * y`
26
27 error: hypotenuse can be computed more accurately
28   --> $DIR/floating_point_powi.rs:16:13
29    |
30 LL |     let _ = (x.powi(2) + y.powi(2)).sqrt();
31    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.hypot(y)`
32
33 error: aborting due to 5 previous errors
34