public int Next()
{
uint t = _x^(_x<<11);
_x=_y; _y=_z; _z=_w;
_w = (_w^(_w>>19))^(t^(t>>8));
// Handle the special case where the value int.MaxValue is generated. This is outside of
// the range of permitted values, so we therefore call Next() to try again.
uint rtn = _w&0x7FFFFFFF;
if(rtn==0x7FFFFFFF) {
return Next();
}
return (int)rtn;
}
public void Next() { int sampleCount = 10000000; XorShiftRandom rng = new XorShiftRandom(); double[] sampleArr = new double[sampleCount]; for(int i=0; i<sampleCount; i++){ sampleArr[i] = rng.Next(); } UniformDistributionTest(sampleArr, 0.0, int.MaxValue); }