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

Feature request: Stdlib.Random.int62 #9487

Closed
UnixJunkie opened this issue Apr 23, 2020 · 4 comments
Closed

Feature request: Stdlib.Random.int62 #9487

UnixJunkie opened this issue Apr 23, 2020 · 4 comments

Comments

@UnixJunkie
Copy link
Contributor

UnixJunkie commented Apr 23, 2020

Dear maintainers,

From reading the documentation for Random.int, I understand it
could be named Random.int30.
But, nowadays we have 64 bits integers, so we might want
to have a Random.int62 that would give us a random
integer for the 64 bits era.

That is to say: Random.int is from the OCaml 32 bits era.
I pledge for the addition of Random.int62, which would be its counterpart
for the 64 bits era.

If people are interested, I will try to send a PR.

The interface would be:

val Random.int62: int -> int

Best regards,
F.

@dra27
Copy link
Member

dra27 commented Apr 23, 2020

Not sure why it needs a new function (especially as that would have to fail on 32-bit systems) - I've pushed a tentative extension of Random.int but I'm not sure if there's a history as to why it was constrained to 2^30 in the first place.

@UnixJunkie
Copy link
Contributor Author

Why a new function: to not change the behavior of the existing one and hence satisfy upward compatibility.
The newly introduced function would indeed have to fail on 32-bit systems, however if this is documented, I don't see any problem with that.

@UnixJunkie UnixJunkie changed the title Feature request: Stdlib.Random.int63 Feature request: Stdlib.Random.int62 Apr 24, 2020
@nojb nojb added the stdlib label Jun 15, 2020
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jun 18, 2021
@Octachron
Copy link
Member

Fixed by #9489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants