diff --git a/beacon_chain/fork_choice_rule/distributions.nim b/beacon_chain/fork_choice_rule/distributions.nim index 20d6457f5..fb885da1a 100644 --- a/beacon_chain/fork_choice_rule/distributions.nim +++ b/beacon_chain/fork_choice_rule/distributions.nim @@ -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