private void SeedInitialization(ulong seed) { /* initializes mt with a seed */ ulong s = (seed != 0 ? seed : SeedGenerator.Instance().Get()); _mt[0] = s & 0xffffffffUL; for (_mti = 1; _mti < N; _mti++) { _mt[_mti] = (1812433253UL * (_mt[_mti - 1] ^ (_mt[_mti - 1] >> 30)) + (ulong)_mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ _mt[_mti] &= 0xffffffffUL; /* for >32 bit machines */ } }