Mention thread-safety

This commit is contained in:
mratsim 2018-09-06 18:16:11 +02:00
parent e315734381
commit 32dbdc860b
1 changed files with 2 additions and 2 deletions

View File

@ -12,8 +12,9 @@
import math, random
proc normal_distribution(mean = 0.0, std = 1.0): int =
proc normal_distribution*(mean = 0.0, std = 1.0): int =
## Return an integer sampled from a normal distribution (gaussian)
## ⚠ This is not thread-safe
# Implementation via the Box-Muller method
# See https://en.wikipedia.org/wiki/BoxMuller_transform
@ -34,7 +35,6 @@ proc normal_distribution(mean = 0.0, std = 1.0): int =
z1 = R * sin(2 * PI * u2)
return int(z0 * std + mean)
when isMainModule:
import sequtils, stats, strformat