Skip to content

Commit 33fa855

Browse files
kostya-shianlancetaylor
authored andcommitted
math/rand: fix comment about bits of seed used by the default Source
Fixes #15788 Change-Id: I5a1fd1e5992f1c16cf8d8437d742bf02e1653b9c Reviewed-on: https://go-review.googlesource.com/23461 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent 4fcb4eb commit 33fa855

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/math/rand/rand.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ var globalRand = New(&lockedSource{src: NewSource(1)})
179179

180180
// Seed uses the provided seed value to initialize the default Source to a
181181
// deterministic state. If Seed is not called, the generator behaves as
182-
// if seeded by Seed(1). Only uses the bottom 31 bits of seed; the top 33
183-
// bits are ignored.
182+
// if seeded by Seed(1). Seed values that have the same remainder when
183+
// divided by 2^31-1 generate the same pseudo-random sequence.
184184
func Seed(seed int64) { globalRand.Seed(seed) }
185185

186186
// Int63 returns a non-negative pseudo-random 63-bit integer as an int64

0 commit comments

Comments
 (0)