summary refs log tree commit diff stats
path: root/lib/pure/random.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/random.nim')
-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 85466ed9e..86db7da49 100644
--- a/lib/pure/random.nim
+++ b/lib/pure/random.nim
@@ -513,6 +513,7 @@ proc initRand*(seed: int64): Rand =
 
     let now = getTime()
     var r2 = initRand(now.toUnix * 1_000_000_000 + now.nanosecond)
+  doAssert seed != 0 # 0 causes `rand(int)` to always return 0 for example.
   result.a0 = ui(seed shr 16)
   result.a1 = ui(seed and 0xffff)
   discard next(result)