RandomSourceExtensions.NextInt32 Method

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

NextInt32(IRandomSource) Returns a non-negative random 32-bit integer.
NextInt32<TGenerator>(IRandomSource<TGenerator>) Returns a non-negative random 32-bit integer.

NextInt32(IRandomSource)

Returns a non-negative random 32-bit integer.
C#
public static int NextInt32(
	this IRandomSource rng
)

Parameters

rng  IRandomSource
 

Return Value

Int32
A 32-bit signed integer that is greater than or equal to 0 and less than or equal to MaxValue.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRandomSource. 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).

NextInt32<TGenerator>(IRandomSource<TGenerator>)

Returns a non-negative random 32-bit integer.
C#
public static int NextInt32<TGenerator>(
	this IRandomSource<TGenerator> rng
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

rng  IRandomSource<TGenerator>
 

Type Parameters

TGenerator

Return Value

Int32
A 32-bit signed integer that is greater than or equal to 0 and less than or equal to MaxValue.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRandomSource<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