-
Notifications
You must be signed in to change notification settings - Fork 432
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
StepRng almost always produces bool false #1303
Comments
The result will be
If you set
|
Thank you! Perhaps it could be documented better? Not specifically explaining this scenario involving bools, but how using this struct relates to the internal logic of Are there any other tools in the |
This RNG only directly implements In other words, by documenting this we might give users the false expectation that behaviour is stable. It's not (though in practice it won't change often). |
What about a note something like
|
I was trying to use
StepRng
to produce booltrue
, and found that I much harder than expected.i.e. the following assertion is almost always true.
I was able to get a
true
when "i=2147484" "j=2147484" & "k=999".(edit: it becomes
true
when the start is4013646938112
, and then is consistentlytrue
, for a while at least)I guess based on response for #1248 that there isn't much love for
StepRng
, and maybe this is just an unfortunate effect ofStepRng
My real motivation is looking for a solution to cksac/fake-rs#128. I am trying to build a generator that is reasonably random most of the time, except when asked to produce a bool, it should always produce true. Is this possible?
My crude guess was if I could eliminate
0
from the rng responses, this would eliminate generatingfalse
, andStepRng
seemed like a useful way to experiment with this idea.The text was updated successfully, but these errors were encountered: