diff --git a/lib/pure/random.nim b/lib/pure/random.nim index 85466ed9efa0..86db7da497d0 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)