Summary
Just a minor discrepancy in the documentation that needs fixing (it says degrees but the angle uses the range -pi..pi)
Details
Changing the print message of the example (degrees should be radians)
Current:
// Ranged sampling:
use std::f32::consts::PI;
println!("Angle: {} degrees", rand::random_range(-PI..PI));
Revised:
// Ranged sampling:
use std::f32::consts::PI;
println!("Angle: {} radians", rand::random_range(-PI..PI));
Note: I created this issue before but it was closed since I failed to mention the location of this documentation. I initially saw it on the docs.rs documentation, https://docs.rs/rand/latest/rand/. In the code it is line 22 of src/lib.rs
Motivation
It's a mistake in the documentation that makes it look unpolished.
Alternatives
Not changing it. I guess it's easier in the short term but there might be more people like me in the future wondering why it says degrees and not radians.
Summary
Just a minor discrepancy in the documentation that needs fixing (it says degrees but the angle uses the range -pi..pi)
Details
Changing the print message of the example (degrees should be radians)
Current:
Revised:
Note: I created this issue before but it was closed since I failed to mention the location of this documentation. I initially saw it on the docs.rs documentation, https://docs.rs/rand/latest/rand/. In the code it is line 22 of src/lib.rs
Motivation
It's a mistake in the documentation that makes it look unpolished.
Alternatives
Not changing it. I guess it's easier in the short term but there might be more people like me in the future wondering why it says degrees and not radians.