mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-31 00:36:10 +00:00
Mention thread-safety
This commit is contained in:
parent
e315734381
commit
32dbdc860b
@ -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/Box–Muller_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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user