Closed
Description
Quoting the Rust References and Lifetimes Guide:
Circle(_, radius) => 0.5 * tau * radius * radius,
...
(Like any up-to-date engineer, we use the tau circle constant and not that dreadfully outdated notion of pi).
Without arguing over the merits of pi versus tau, a Rust guide is not the place for introducing a less common mathematical notation that most people will not have seen. Doubly so because this is one of the specific cases where tau is less clear than pi; the equivalent code with pi would not need the extra factor of 0.5. And triply so because this should be using a constant from the standard library, like std::f64::consts::PI
.
All three make this an unnecessary distraction in the middle of a Rust tutorial guide.
Metadata
Metadata
Assignees
Labels
No labels