Example #1
0
        public int NextInt(int lower, int upper)
        {
            // [ lower; upper [
            Assert(lower < upper, "lower range cannot be bigger then upper range!");

            return((int)((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer))
                         % (uint32)(Math.Abs(upper - lower))
                         + lower));
        }
Example #2
0
 public uint32 NextUInt32(uint32 range)
 {
     // [ 0; range [
     return((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer) % (range)));
 }
Example #3
0
 public uint64 NextUInt64()
 {
     return(RNG_XORShift.Xorshift128Plus(ref _seedBuffer));
 }