How to multiply/divide/add/subtract numbers of different types?
问题 I'm working through the second edition of the Rust handbook, and decided to try and make the classic Celsius-to-Fahrenheit converter: fn c_to_f(c: f32) -> f32 { return ( c * ( 9/5 ) ) + 32; } Compiling this with cargo build will yield the compile-time error: error[E0277]: the trait bound `f32: std::ops::Mul<{integer}>` is not satisfied --> src/main.rs:2:12 | 2 | return (c * (9 / 5)) + 32; | ^^^^^^^^^^^^^ the trait `std::ops::Mul<{integer}>` is not implemented for `f32` | = note: no