summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorVladar4 <vladar4@gmail.com>2017-01-20 20:35:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-01-20 19:35:20 +0100
commitea4397fbb084a8d316ae71eaf4f66941e4e8a97c (patch)
tree6a8476aad306026d1de109e47f72b2c087845e5d /lib
parentcdebcf23d94939690ebdd08151984d926d9b566e (diff)
downloadNim-ea4397fbb084a8d316ae71eaf4f66941e4e8a97c.tar.gz
fixed bug when the first random(max: float) call is the same value, regardless of randomize() (#5257)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/random.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/random.nim b/lib/pure/random.nim
index b4681610a..8d463576a 100644
--- a/lib/pure/random.nim
+++ b/lib/pure/random.nim
@@ -105,6 +105,7 @@ proc randomize*(seed: int) {.benign.} =
   ## Initializes the random number generator with a specific seed.
   state.a0 = ui(seed shr 16)
   state.a1 = ui(seed and 0xffff)
+  discard next(state)
 
 proc shuffle*[T](x: var openArray[T]) =
   ## Will randomly swap the positions of elements in a sequence.