Closed
Description
let x = f64::from(32) + 2.0 * 4.0;
clippy suggests
warning: consider using mul_add() for better numerical precision
--> src/main.rs:3:10
|
3 | let x = f64::from(32) + 2.0 * 4.0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2.0.mul_add(4.0, f64::from(32))`
|
but
let x = 2.0.mul_add(4.0, f64::from(32));
does not compile:
error[E0599]: no method named `mul_add` found for type `{float}` in the current scope
--> src/main.rs:4:15
|
4 | let x = 2.0.mul_add(4.0, f64::from(32));
| ^^^^^^^ method not found in `{float}`