3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
8 # See: <http://rosettacode.org/wiki/Random_numbers>
11 # Uniform distribution, (0..1]
12 fun drand
: Float do return 1.0.rand
14 # Pseudorandom numbers with a mean of 1.0 and a standard deviation of 0.5
15 fun random_normal
: Float do return (-2.0 * drand
.log
).sqrt
* (2.0 * pi
* drand
).cos
17 for i
in [0..1000] do print random_normal