rust-exercises
rust-exercises copied to clipboard
Shapes: Add warning about order dependence in multiplication with PI
In Shapes the Circle
area requires PI
which in the solution uses PI at the end. But if you change the order
std::f32::consts::PI.into() * self.radius * self.radius
This does not work because the compiler fails to infer the type and you need explicit conversion first.