2020-02-23 02:04:11 -06:00
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:19:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = a * b + c;
|
|
|
|
| ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:20:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
LL | let _ = a * b - c;
|
|
|
|
| ^^^^^^^^^ help: consider using: `a.mul_add(b, -c)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:21:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2020-02-23 02:04:11 -06:00
|
|
|
LL | let _ = c + a * b;
|
|
|
|
| ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:22:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | let _ = c - a * b;
|
|
|
|
| ^^^^^^^^^ help: consider using: `a.mul_add(-b, c)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:23:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = a + 2.0 * 4.0;
|
|
|
|
| ^^^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4.0, a)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:24:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = a + 2. * 4.;
|
|
|
|
| ^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4., a)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:26:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = (a * b) + c;
|
|
|
|
| ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:27:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = c + (a * b);
|
|
|
|
| ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:28:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = a * b * c + d;
|
|
|
|
| ^^^^^^^^^^^^^ help: consider using: `(a * b).mul_add(c, d)`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:30:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = a.mul_add(b, c) * a.mul_add(b, c) + a.mul_add(b, c) + c;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `a.mul_add(b, c).mul_add(a.mul_add(b, c), a.mul_add(b, c))`
|
|
|
|
|
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:31:13
|
2020-02-23 02:04:11 -06:00
|
|
|
|
|
|
|
|
LL | let _ = 1234.567_f64 * 45.67834_f64 + 0.0004_f64;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1234.567_f64.mul_add(45.67834_f64, 0.0004_f64)`
|
|
|
|
|
2020-07-14 07:59:59 -05:00
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:33:13
|
2020-07-14 07:59:59 -05:00
|
|
|
|
|
|
|
|
LL | let _ = (a * a + b).sqrt();
|
|
|
|
| ^^^^^^^^^^^ help: consider using: `a.mul_add(a, b)`
|
|
|
|
|
2023-11-02 11:35:56 -05:00
|
|
|
error: multiply and add expressions can be calculated more efficiently and accurately
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_mul_add.rs:36:13
|
2023-11-02 11:35:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a - (b * u as f64);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: consider using: `b.mul_add(-(u as f64), a)`
|
|
|
|
|
|
|
|
error: aborting due to 13 previous errors
|
2020-02-23 02:04:11 -06:00
|
|
|
|