mirror of
https://github.com/golang/go.git
synced 2024-09-30 23:07:22 +00:00
math/rand: document default initial seed for global generator
Fixes #2044. R=golang-dev CC=golang-dev https://golang.org/cl/5541056
This commit is contained in:
parent
b16f3a2d50
commit
5163e7aa27
@ -107,7 +107,9 @@ func (r *Rand) Perm(n int) []int {
|
|||||||
|
|
||||||
var globalRand = New(&lockedSource{src: NewSource(1)})
|
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) }
|
func Seed(seed int64) { globalRand.Seed(seed) }
|
||||||
|
|
||||||
// Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
|
// Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
|
||||||
|
Loading…
Reference in New Issue
Block a user