-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tour: a word about rand.Intn #12370
Labels
Milestone
Comments
[but I see your approach in keeping it very simple. Perhaps you mean in this context that if you rerun the example you will always get the same number. ] I mean that for each sequence of calls to Intn you will get the same sequence of return values. |
I'll see if I can clarify this. |
CL https://golang.org/cl/15555 mentions this issue. |
gopherbot
pushed a commit
to golang/website
that referenced
this issue
May 26, 2021
Technically rand.Intn will always return the same sequence of numbers, however in this context, re-running the example will always produce the same value. Fixes golang/go#12370 Change-Id: Iea87a4b1b0db1a919a35b00d0d4af497fafd1319 Reviewed-on: https://go-review.googlesource.com/15555 Reviewed-by: Andrew Gerrand <adg@golang.org> X-Tour-Commit: a2f217e397d4a7209587875306ca65fe9b63a3e9
MK825
added a commit
to MK825/website
that referenced
this issue
Oct 18, 2022
Technically rand.Intn will always return the same sequence of numbers, however in this context, re-running the example will always produce the same value. Fixes golang/go#12370 Change-Id: Iea87a4b1b0db1a919a35b00d0d4af497fafd1319 Reviewed-on: https://go-review.googlesource.com/15555 Reviewed-by: Andrew Gerrand <adg@golang.org> X-Tour-Commit: a2f217e397d4a7209587875306ca65fe9b63a3e9
KimuraDanaka119
added a commit
to KimuraDanaka119/go-tour-jp
that referenced
this issue
Jun 4, 2023
Technically rand.Intn will always return the same sequence of numbers, however in this context, re-running the example will always produce the same value. Fixes golang/go#12370 Change-Id: Iea87a4b1b0db1a919a35b00d0d4af497fafd1319 Reviewed-on: https://go-review.googlesource.com/15555 Reviewed-by: Andrew Gerrand <adg@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Context: http://tour.golang.org/basics/1
Hi -- this is a nice tutorial!
I did want to mention that I think your verbiage is a little off here:
Note: the environment in which these programs are executed is deterministic, so rand.Intn will always return the same number.
Don't you mean that it will always return the same sequence of numbers?
The text was updated successfully, but these errors were encountered: