Lib/Redzen/Numerics/FastRandom.cs
/// <summary>
/// Generates a random int over the range 0 to int.MaxValue-1.
/// MaxValue is not generated in order to remain functionally equivalent to System.Random.Next().
/// This does slightly eat into some of the performance gain over System.Random, but not much.
/// For better performance see:
/// 
/// Call NextInt() for an int over the range 0 to int.MaxValue.
/// 
/// Call NextUInt() and cast the result to an int to generate an int over the full Int32 value range
/// including negative values. 
/// </summary>
Generates a random int over the range 0 to int.MaxValue-1.
MaxValue is not generated in order to remain functionally equivalent to System.Random.Next().
This does slightly eat into some of the performance gain over System.Random, but not much.
For better performance see.

Call NextInt() for an int over the range 0 to int.MaxValue.

Call NextUInt() and cast the result to an int to generate an int over the full Int32 value range
including negative values.
Generates a random int over the range 0 to int . MaxValue - 1 . MaxValue is not generated in order to remain functionally equivalent to System . Random . Next () . This does slightly eat into some of the performance gain over System . Random but not much . For better performance see . Call NextInt () for an int over the range 0 to int . MaxValue . Call NextUInt () and cast the result to an int to generate an int over the full Int32 value range including negative values .
public int Next()
        {
            uint t = _x ^ (_x << 11);
            _x = _y; _y = _z; _z = _w;
            _w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8));
            uint rtn = _w & 0x7FFFFFFF;
            if (rtn == 0x7FFFFFFF)
            {
                return Next();
            }
            return (int)rtn;
        }
public int Next ( ) { uint t = _x ^ ( _x << 11 ) ; _x = _y ; _y = _z ; _z = _w ; _w = ( _w ^ ( _w >> 19 ) ) ^ ( t ^ ( t >> 8 ) ) ; uint rtn = _w & 0x7FFFFFFF ; if ( rtn == 0x7FFFFFFF ) { return Next ( ) ; } return ( int ) rtn ; }
Generates a random int over the range 0 to int.MaxValue-1.
Generates a random int over the range 0 to int . MaxValue - 1 .
// 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.