Rand |
Note: This API is now obsolete.
[ObsoleteAttribute("This legacy PRNG algorithm should replaced with a more modern and effective one")] public sealed class RandEcuyer88 : RandCustomBase
The RandEcuyer88 type exposes the following members.
Name | Description | |
---|---|---|
RandEcuyer88 | Constructs an Ecuyer 1988 random class with random seed values. | |
RandEcuyer88(Int32, Int32) | Constructs an Ecuyer 1988 random class with specified seed values. |
This class is included in the library for historical reference. In 1988 it demonstrated the innovative technique of combining LGCs with different periods to create a maximal combined generator. Unfortunately, the internal state is a (large) subset of all possible positive Int32 values, so it generates uniform random numbers that cannot generate all possible 32-bit integer values through the standard Next method. See the following notes. The class should not be used in practise because modern efficient and better behaved replacements are available.
The internal generated 'z' value only takes value from 0 to 2147483561 inclusive, which is 86 less than the number of possible postitive Int32. This means that when the state is converted to a double and multiplied by Int32.MaxValue then some Int32 values cannot be produced. Experiments show for example that 25264513 and 50529026 will not be produced, and somewaht confusingly, neither is expected top Next() value 2147483646 0x7FFFFFFE (max int 2147483647 0x7FFFFFFF is impossible by design). The range of Int32 produced by Next(Int32) will therefore be from 0 to 2147483645 0x7FFFFFFD inclusive with some unproducable numbers evenly distributed through the range.
See: Efficient and Portable Combined Random Number Generators
Long running tests have observed the expected minimum values Next 0 (0x0) from Core 0.0 and the maximum Next 2147483645 (0x7FFFFFFD) from Core 0.999999999534339.