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

StdGen.genRange seems to have wrong value #292

Open
grigorye opened this issue Aug 5, 2019 · 2 comments
Open

StdGen.genRange seems to have wrong value #292

grigorye opened this issue Aug 5, 2019 · 2 comments

Comments

@grigorye
Copy link
Contributor

grigorye commented Aug 5, 2019

public var genRange : (Int, Int) {
return (Int.min, Int.max)
}

I wonder if it should be (1, 2147483562) or something like that (sorry, I have hard time figuring the exact numbers out). I mean, even though the type of the value produced by next is Int, the actual value is defined by the algorithm that operates in subdomain of 32-bit numbers.

@grigorye grigorye changed the title StdGen.genRange seem to have wrong value StdGen.genRange seems to have wrong value Aug 5, 2019
@CodaFi
Copy link
Member

CodaFi commented Aug 5, 2019

Honestly, genRange is an artifact of the old non-deterministic RNG. It should be deprecated and removed in the next point release.

@CodaFi
Copy link
Member

CodaFi commented Aug 12, 2019

Started 2d3b562

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