IMSL C# Numerical Library

Random.Next Method (Int32, Int32)

Returns a nonnegative pseudorandom int in the specified range.

public override int Next(
   int minValue,
   int maxValue
);

Parameters

minValue
An int which specifies the lower bound of the random number returned.
maxValue
An int which specifies the upper bound of the random number to be generated. maxValue must be greater than or equal to zero.

Return Value

An int greater than or equal to minValue and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned.

See Also

Random Class | Imsl.Stat Namespace | Random.Next Overload List