-
-
Notifications
You must be signed in to change notification settings - Fork 473
Closed
Description
A change request is considered a (small) Request-For-Comment, and requires a concrete proposal and motivation.
Summary
Although we can find a mention in the book of how to use f64
it's not clear that doing rand::thread_rng().gen_range(f64::MIN..f64::MAX);
will not give the results intended.
Details
I think potentially guarding the range when doing gen_range
on floats is a good idea. The above will not complain but won't (assume a normal distribution) give floats in the range specified (they will all be < 0).
Motivation
Make it easier for newcomers to the rand
library to not shoot themselves in the foot. Be explicit programmatically in what a function accepts is better than leaving it to documentation (explicit is better than implicit).
Alternatives
Metadata
Metadata
Assignees
Labels
No labels