C# Class nv.PriorityQueue.StaticRandom

Thread-safe equivalent of System.Random, using just static methods. If all you want is a source of random numbers, this is an easy class to use. If you need to specify your own seeds (eg for reproducible sequences of numbers), use System.Random.
Show file Open project: NGPVAN/nv.PriorityQueue

Public Methods

Method Description
Next ( ) : int

Returns a nonnegative random number.

Next ( int max ) : int

Returns a nonnegative random number less than the specified maximum.

Next ( int min, int max ) : int

Returns a random number within a specified range.

NextBytes ( byte buffer ) : void

Fills the elements of a specified array of bytes with random numbers.

NextDouble ( ) : double

Returns a random number between 0.0 and 1.0.

Method Details

Next() public static method

Returns a nonnegative random number.
public static Next ( ) : int
return int

Next() public static method

Returns a nonnegative random number less than the specified maximum.
maxValue is less than zero.
public static Next ( int max ) : int
max int
return int

Next() public static method

Returns a random number within a specified range.
minValue is greater than maxValue.
public static Next ( int min, int max ) : int
min int The inclusive lower bound of the random number returned.
max int /// The exclusive upper bound of the random number returned. /// maxValue must be greater than or equal to minValue. ///
return int

NextBytes() public static method

Fills the elements of a specified array of bytes with random numbers.
buffer is a null reference (Nothing in Visual Basic).
public static NextBytes ( byte buffer ) : void
buffer byte An array of bytes to contain random numbers.
return void

NextDouble() public static method

Returns a random number between 0.0 and 1.0.
public static NextDouble ( ) : double
return double