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

x/tour: a word about rand.Intn #12370

Closed
Geof23 opened this issue Aug 27, 2015 · 4 comments
Closed

x/tour: a word about rand.Intn #12370

Geof23 opened this issue Aug 27, 2015 · 4 comments

Comments

@Geof23
Copy link

Geof23 commented Aug 27, 2015

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?

@Geof23
Copy link
Author

Geof23 commented Aug 27, 2015

[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.

@ianlancetaylor ianlancetaylor changed the title a word about rand.Intn tour: a word about rand.Intn Aug 28, 2015
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Aug 28, 2015
@ianlancetaylor
Copy link
Contributor

CC @adg @campoy

@adg adg self-assigned this Aug 28, 2015
@mikioh mikioh changed the title tour: a word about rand.Intn x/tour: a word about rand.Intn Aug 29, 2015
@kytrinyx
Copy link
Contributor

kytrinyx commented Oct 8, 2015

I'll see if I can clarify this.

@adg adg assigned kytrinyx and unassigned adg Oct 8, 2015
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Oct 9, 2016
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
passionSeven added a commit to passionSeven/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.
Projects
None yet
Development

No branches or pull requests

5 participants