]> Cypherpunks repositories - gostls13.git/commitdiff
math/rand: document default initial seed for global generator
authorScott Lawrence <bytbox@gmail.com>
Mon, 16 Jan 2012 23:13:34 +0000 (18:13 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 16 Jan 2012 23:13:34 +0000 (18:13 -0500)
Fixes #2044.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5541056

src/pkg/math/rand/rand.go

index 459aed1db4fe6768e5ebae5b6a1bd2fff1d08f0d..8955219203075efc02465776f8548d2a3bd82f60 100644 (file)
@@ -107,7 +107,9 @@ func (r *Rand) Perm(n int) []int {
 
 var globalRand = New(&lockedSource{src: NewSource(1)})
 
-// Seed uses the provided seed value to initialize the generator to a deterministic state.
+// Seed uses the provided seed value to initialize the generator to a
+// deterministic state. If Seed is not called, the generator behaves as
+// if seeded by Seed(1).
 func Seed(seed int64) { globalRand.Seed(seed) }
 
 // Int63 returns a non-negative pseudo-random 63-bit integer as an int64.