]> Cypherpunks repositories - gostls13.git/commit
math/rand: improve uniformity of rand.Float64,Float32
authorDavid Chase <drchase@google.com>
Wed, 9 Dec 2015 16:45:36 +0000 (11:45 -0500)
committerDavid Chase <drchase@google.com>
Fri, 11 Dec 2015 15:17:42 +0000 (15:17 +0000)
commit38255cbd1b0b671dae1fa84863f2e63355c61459
tree9e08d424ad28efee1f4a3b22eb4f8e2dfcbc4758
parentdcc821faf84b147cc8a887cb0e576497cfc6cbfd
math/rand: improve uniformity of rand.Float64,Float32

Replaced code that substituted 0 for rounded-up 1 with
code to try again.  This has minimal effect on the existing
stream of random numbers, but restores uniformity.

Fixes #12290.

Change-Id: Ib68f0b0a4a173339bcd0274cc16509f7b0977de8
Reviewed-on: https://go-review.googlesource.com/17670
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/math/rand/rand.go