From 3d6a68727182c05fbbef9ad9e694f2e79b6731de Mon Sep 17 00:00:00 2001
From: Raimo Niskanen This module provides a random number generator. The module contains
- a number of algorithms. The uniform distribution algorithms use the
-
+ This module provides a pseudo random number generator.
+ The module contains a number of algorithms.
+ The uniform distribution algorithms use the
+ For some algorithms, jump functions are provided for generating
non-overlapping sequences for parallel computations.
The jump functions perform calculations
@@ -393,9 +400,34 @@ tests. We suggest to use a sign test to extract a random Boolean value.
Returns a random float uniformly distributed in the value
+
+ Returns a random float uniformly distributed in the value
range
+ The generated numbers are on the form N * 2.0^(-53),
+ that is; equally spaced in the interval.
+
+ This function may return exactly
+ If neither endpoint is desired you can test and re-try
+ like this:
+ Returns, for a specified state, random float
+
+ Returns, for a specified state, random float
uniformly distributed in the value range
+my_uniform() ->
+ case rand:uniform() of
+ 0.0 -> my_uniform();
+ X -> X
+ end
+end.
+
+ The generated numbers are on the form N * 2.0^(-53), + that is; equally spaced in the interval. +
+
+ This function may return exactly
+ If neither endpoint is desired you can test and re-try + like this: +
++my_uniform(State) -> + case rand:uniform(State) of + {0.0, NewState} -> my_uniform(NewState); + Result -> Result + end +end.+