Navigation Menu

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

math/rand: add a Uint64 method #4254

Closed
gopherbot opened this issue Oct 17, 2012 · 7 comments
Closed

math/rand: add a Uint64 method #4254

gopherbot opened this issue Oct 17, 2012 · 7 comments
Milestone

Comments

@gopherbot
Copy link

by jacobsa@google.com:

The Rand interface has methods for several types of random integers, including
uint32 and int63, but no uint64. I need random integers in [0, 2^64). I can of
course use two calls to Uint32 to do what I need, but see discussion here:

    https://groups.google.com/group/golang-nuts/browse_thread/thread/2a57bcef8953d44a/335e3adb37bb4333

It would be nice to add this for 2.0, or whenever it's next okay to make a
break with the current API.
@minux
Copy link
Member

minux commented Oct 17, 2012

Comment 1:

Labels changed: added priority-later, removed priority-triage, go1.1.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go2.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 4:

Labels changed: added release-none.

@gopherbot gopherbot added accepted v2 A language change or incompatible library change labels Mar 3, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@gopherbot
Copy link
Author

CL https://golang.org/cl/27253 mentions this issue.

@chris-martin
Copy link

Some workarounds, for the convenience of anyone like me who stumbled on this issue: https://stackoverflow.com/questions/39756133/how-do-you-generate-a-random-uint64-in-go/

@bradfitz bradfitz modified the milestones: Go1.8, Unplanned Sep 30, 2016
@bradfitz bradfitz removed the v2 A language change or incompatible library change label Sep 30, 2016
@gopherbot
Copy link
Author

CL https://golang.org/cl/33456 mentions this issue.

gopherbot pushed a commit that referenced this issue Nov 23, 2016
There is some code value too: types intending to implement
Source64 can write a conversion confirming that.

For #4254 and the Go 1.8 release notes.

Change-Id: I7fc350a84f3a963e4dab317ad228fa340dda5c66
Reviewed-on: https://go-review.googlesource.com/33456
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Nov 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants