Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapes: Add warning about order dependence in multiplication with PI #35

Open
amanjeev opened this issue Aug 25, 2023 · 0 comments
Open

Comments

@amanjeev
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant