Random Generator Extensions.Next Method
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Next<TGenerator>(TGenerator) | Generates a random 32-bit non-negative integer less than MaxValue. |
| Next<TGenerator>(TGenerator, Int32) | Generates a random 32-bit non-negative integer less than the specified maximum. |
| Next<TGenerator>(TGenerator, Int32, Int32) | Generates a random 32-bit integer within a specified range. |
Next<TGenerator>(TGenerator)
Generates a random 32-bit non-negative integer less than MaxValue.
public static int Next<TGenerator>(
this ref TGenerator generator
)
where TGenerator : struct, new(), IRandomGenerator
Parameters
- generator TGenerator
Type Parameters
- TGenerator
Return Value
Int32Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type TGenerator. 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).Next<TGenerator>(TGenerator, Int32)
Generates a random 32-bit non-negative integer less than the specified maximum.
public static int Next<TGenerator>(
this ref TGenerator generator,
int maxValue
)
where TGenerator : struct, new(), IRandomGenerator
Parameters
- generator TGenerator
- maxValue Int32
Type Parameters
- TGenerator
Return Value
Int32Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type TGenerator. 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).Next<TGenerator>(TGenerator, Int32, Int32)
Generates a random 32-bit integer within a specified range.
public static int Next<TGenerator>(
this ref TGenerator generator,
int minValue,
int maxValue
)
where TGenerator : struct, new(), IRandomGenerator
Parameters
Type Parameters
- TGenerator