MoreEnumerableRandom Method (Random, Int32) |
Returns an infinite sequence of random integers between zero and a
given maximum using the supplied random number generator.
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntax public static IEnumerable<int> Random(
Random rand,
int maxValue
)
Public Shared Function Random (
rand As Random,
maxValue As Integer
) As IEnumerable(Of Integer)
public:
static IEnumerable<int>^ Random(
Random^ rand,
int maxValue
)
static member Random :
rand : Random *
maxValue : int -> IEnumerable<int>
Parameters
- rand
- Type: SystemRandom
Random generator used to produce values - maxValue
- Type: SystemInt32
Exclusive upper bound for random values returned
Return Value
Type:
IEnumerableInt32An infinite sequence of random integers
Exceptions Exception | Condition |
---|
ArgumentNullException | Thrown if rand is . |
See Also