diff options
author | Simon Hafner <hafnersimon@gmail.com> | 2012-09-06 17:25:52 -0500 |
---|---|---|
committer | Simon Hafner <hafnersimon@gmail.com> | 2012-09-06 17:25:52 -0500 |
commit | e9bbc7235dc017a97fdc831efdaacb5325984d18 (patch) | |
tree | f794657f289f518d6a99aa765a161dbd6eab5d12 /lib | |
parent | 33cabeb04d4dc00f4edf40096f790b510f915dd9 (diff) | |
download | Nim-e9bbc7235dc017a97fdc831efdaacb5325984d18.tar.gz |
no uniqueCounter it is
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/pure/math.nim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim index d20fbc2ca..8a894e080 100755 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -188,11 +188,10 @@ when not defined(ECMAScript): proc rand(): cint {.importc: "rand", nodecl.} proc drand48(): float {.importc: "drand48", nodecl.} - var uniqueCounter: int = 0 proc randomize() = - srand(gettime(nil) + cint(uniqueCounter)) - srand48(gettime(nil) + cint(uniqueCounter)) - atomicInc(uniqueCounter) + let x = gettime(nil) + srand(x) + srand48(x) proc random(max: int): int = result = int(rand()) mod max proc random(max: float): float = |