public MultiplyWithCarryGenerateRandom(long[] seeds, long carry, int r, long multiplier) { SetR(r); SetMultiplier(multiplier); _seed = new long[r]; if (seeds == null || seeds.Length == 0) { seeds = new long[] { Environment.TickCount }; } var rnd = new LinearCongruentialRandom(seeds[0]); _c = (carry & 0xFFFFFFFFL) % multiplier; for (int i = 0; i < r; ++i) { if (i < seeds.Length) { _seed[i] = seeds[i] & 0xFFFFFFFFL; } else { _seed[i] = rnd.NextInt() & 0xFFFFFFFFL; } if (_seed[i] == 0xFFFFFFFFL) { _seed[i] = 1L; } } }