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

Bias to smaller numbers #752

Open
AlexRFox opened this issue Jan 24, 2023 · 1 comment
Open

Bias to smaller numbers #752

AlexRFox opened this issue Jan 24, 2023 · 1 comment

Comments

@AlexRFox
Copy link

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() {

@bodiam
Copy link

bodiam commented Jan 24, 2023

Alex, this library is no longer maintained. Have a look at www.datafaker.net for a drop-in replacement

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

2 participants