| RandomHelperNextInteger Method |
Gets a random integer value that lies in the interval [min,
max].
Namespace: DigitalRune.Mathematics.StatisticsAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public static int NextInteger(
this Random random,
int min,
int max
)
<ExtensionAttribute>
Public Shared Function NextInteger (
random As Random,
min As Integer,
max As Integer
) As Integer
public:
[ExtensionAttribute]
static int NextInteger(
Random^ random,
int min,
int max
)
[<ExtensionAttribute>]
static member NextInteger :
random : Random *
min : int *
max : int -> int
Parameters
- random
- Type: SystemRandom
The random number generator. If this parameter is , the global random
number generator (see Random) is used.
- min
- Type: SystemInt32
The minimal allowed value. - max
- Type: SystemInt32
The maximal allowed value. (Must be less than MaxValue.)
Return Value
Type:
Int32A random integer value within the bounds [min, max].
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also