Click or drag to resize
StdRandomUniform Method (Int32)
Returns a random integer uniformly in [0, n).

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static int Uniform(
	int n
)

Parameters

n
Type: SystemInt32
n number of possible integers

Return Value

Type: Int32
a random integer uniformly between 0 (inclusive) and N (exclusive)
Exceptions
ExceptionCondition
ArgumentExceptionif n <= 0
See Also