Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(22)

Issue 11705043: code review 11705043: math/rand: mention Seed in overview, add another top-le... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by adg
Modified:
11 years, 8 months ago
Reviewers:
r, remyoudompheng
CC:
golang-dev, aam, r
Visibility:
Public.

Description

math/rand: mention Seed in overview, add another top-level example Fixes issue 5937.

Patch Set 1 #

Total comments: 2

Patch Set 2 : diff -r dcc576d21f17 https://code.google.com/p/go #

Total comments: 1

Patch Set 3 : diff -r dcc576d21f17 https://code.google.com/p/go #

Patch Set 4 : diff -r 4bfbd12d6f4f https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -15 lines) Patch
M src/pkg/math/rand/example_test.go View 1 1 chunk +30 lines, -2 lines 0 comments Download
M src/pkg/math/rand/rand.go View 1 2 3 chunks +28 lines, -13 lines 0 comments Download

Messages

Total messages: 9
adg
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 8 months ago (2013-07-23 03:51:07 UTC) #1
aam
https://codereview.appspot.com/11705043/diff/1/src/pkg/math/rand/example_test.go File src/pkg/math/rand/example_test.go (right): https://codereview.appspot.com/11705043/diff/1/src/pkg/math/rand/example_test.go#newcode14 src/pkg/math/rand/example_test.go:14: // These tests serve as an example but also ...
11 years, 8 months ago (2013-07-23 04:15:01 UTC) #2
adg
Thanks https://codereview.appspot.com/11705043/diff/1/src/pkg/math/rand/example_test.go File src/pkg/math/rand/example_test.go (right): https://codereview.appspot.com/11705043/diff/1/src/pkg/math/rand/example_test.go#newcode14 src/pkg/math/rand/example_test.go:14: // These tests serve as an example but ...
11 years, 8 months ago (2013-07-23 04:16:58 UTC) #3
r
https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go File src/pkg/math/rand/rand.go (right): https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go#newcode8 src/pkg/math/rand/rand.go:8: // source that may be seeded with the Seed ...
11 years, 8 months ago (2013-07-23 05:01:05 UTC) #4
adg
Hello golang-dev@googlegroups.com, mirtchovski@gmail.com, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 8 months ago (2013-07-23 05:07:51 UTC) #5
r
LGTM
11 years, 8 months ago (2013-07-23 06:06:37 UTC) #6
adg
*** Submitted as https://code.google.com/p/go/source/detail?r=f6a20261d881 *** math/rand: mention Seed in overview, add another top-level example Fixes ...
11 years, 8 months ago (2013-07-23 06:07:36 UTC) #7
remyoudompheng
2013/7/23 <r@golang.org>: > > https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go > File src/pkg/math/rand/rand.go (right): > > https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go#newcode8 > src/pkg/math/rand/rand.go:8: // ...
11 years, 8 months ago (2013-07-23 06:12:13 UTC) #8
adg
11 years, 8 months ago (2013-07-23 06:14:21 UTC) #9
It is probably worth mentioning. The assumption throughout the standard
library is "not thread safe unless otherwise specified".


On 23 July 2013 16:12, Rémy Oudompheng <remyoudompheng@gmail.com> wrote:

> 2013/7/23  <r@golang.org>:
> >
> >
> https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go
> > File src/pkg/math/rand/rand.go (right):
> >
> >
>
https://codereview.appspot.com/11705043/diff/7001/src/pkg/math/rand/rand.go#n...
> > src/pkg/math/rand/rand.go:8: // source that may be seeded with the Seed
> > function.
> > Random numbers are generated by a Source. Top-level functions, such as
> > Float64 and Int, use a default shared Source  that produces a
> > deterministic sequence of values each time a program is run. Use the
> > Seed function to initialize the global Source if different behavior is
> > required for each run.
> >
> > and then on the global Int function etc. say
> >
> > ... from the default Source.
> >
>
> Should it be mentioned that the "default source" is goroutine-safe?
> The only Source factory function is NewSource returning a
> non-goroutine safe version.
>
> Rémy.
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b