From: Scott Lawrence Date: Mon, 16 Jan 2012 23:13:34 +0000 (-0500) Subject: math/rand: document default initial seed for global generator X-Git-Tag: weekly.2012-01-20~93 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5163e7aa2724c0c81feea56f7b243b122a1d3bdf;p=gostls13.git math/rand: document default initial seed for global generator Fixes #2044. R=golang-dev CC=golang-dev https://golang.org/cl/5541056 --- diff --git a/src/pkg/math/rand/rand.go b/src/pkg/math/rand/rand.go index 459aed1db4..8955219203 100644 --- a/src/pkg/math/rand/rand.go +++ b/src/pkg/math/rand/rand.go @@ -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.