-
Notifications
You must be signed in to change notification settings - Fork 869
Open
Description
I'm not sure if this is intentional or not, so I'm not sure if this should be documented or fixed. I believe this function creates a bias to smaller numbers, because it has a 1/9 chance to pick lengths from 1 to 9 inclusively, then it generates a random number from 0 to 10^(randomly picked size). So there's a 1/9 chance it'll pick a length of 1, then a 1/10 chance it'll pick a 0, leading to a 1/90 chance to pick 0 in a range that goes from 0 to 10^9.
| public long randomNumber() { |
Metadata
Metadata
Assignees
Labels
No labels