101 for(i=j; i<624; i++) {
102 _Mt[i] = (1812433253 * ( _Mt[i-1] ^ ( _Mt[i-1] >> 30)) + i);
119 const unsigned int kTemperingMaskB = 0x9d2c5680;
120 const unsigned int kTemperingMaskC = 0xefc60000;
121 const unsigned int kUpperMask = 0x80000000;
122 const unsigned int kLowerMask = 0x7fffffff;
123 const unsigned int kMatrixA = 0x9908b0df;
125 if (_count624 >= kN) {
128 for (i=0; i < kN-kM; i++) {
129 y = (_Mt[i] & kUpperMask) | (_Mt[i+1] & kLowerMask);
130 _Mt[i] = _Mt[i+kM] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
133 for ( ; i < kN-1 ; i++) {
134 y = (_Mt[i] & kUpperMask) | (_Mt[i+1] & kLowerMask);
135 _Mt[i] = _Mt[i+kM-kN] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
138 y = (_Mt[kN-1] & kUpperMask) | (_Mt[0] & kLowerMask);
139 _Mt[kN-1] = _Mt[kM-1] ^ (y >> 1) ^ ((y & 0x1) ? kMatrixA : 0x0);
143 y = _Mt[_count624++];
145 y ^= ((y << 7 ) & kTemperingMaskB );
146 y ^= ((y << 15) & kTemperingMaskC );
149 if (y)
return ( (
double) y * 2.3283064365386963e-10);