RandomGeneratorExtensions.Next Method

Definition

Namespace: Numerics.NET.Random
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.
C#
public static int Next<TGenerator>(
	this ref TGenerator generator
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

generator  TGenerator
 

Type Parameters

TGenerator

Return Value

Int32

Usage 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.
C#
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

Int32

Usage 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.
C#
public static int Next<TGenerator>(
	this ref TGenerator generator,
	int minValue,
	int maxValue
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

generator  TGenerator
 
minValue  Int32
 
maxValue  Int32
 

Type Parameters

TGenerator

Return Value

Int32

Usage 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).

See Also