RandomSourceExtensions.NextInt64 Method

Definition

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

Overload List

NextInt64(IRandomSource) Returns a non-negative random 64-bit integer.
NextInt64(IRandomSource, Int64) Returns a non-negative random 64-bit integer that is less than the specified maximum.
NextInt64(IRandomSource, Int64, Int64) Returns a random 64-bit integer that is within a specified range.
NextInt64<TGenerator>(IRandomSource<TGenerator>) Returns a non-negative random 64-bit integer.
NextInt64<TGenerator>(IRandomSource<TGenerator>, Int64) Returns a non-negative random 64-bit integer that is less than the specified maximum.
NextInt64<TGenerator>(IRandomSource<TGenerator>, Int64, Int64) Returns a random 64-bit integer that is within a specified range.

NextInt64(IRandomSource)

Returns a non-negative random 64-bit integer.
C#
public static long NextInt64(
	this IRandomSource rng
)

Parameters

rng  IRandomSource
 

Return Value

Int64
A 64-bit signed integer that is greater than or equal to 0 and less than 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).

NextInt64<TGenerator>(IRandomSource<TGenerator>)

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

Parameters

rng  IRandomSource<TGenerator>
 

Type Parameters

TGenerator

Return Value

Int64
A 64-bit signed integer that is greater than or equal to 0 and less than 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).

NextInt64(IRandomSource, Int64)

Returns a non-negative random 64-bit integer that is less than the specified maximum.
C#
public static long NextInt64(
	this IRandomSource rng,
	long maxValue
)

Parameters

rng  IRandomSource
 
maxValue  Int64
The exclusive upper bound of the random number to be generated.

Return Value

Int64
A 64-bit signed integer that is greater than or equal to 0, and less than 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).

NextInt64<TGenerator>(IRandomSource<TGenerator>, Int64)

Returns a non-negative random 64-bit integer that is less than the specified maximum.
C#
public static long NextInt64<TGenerator>(
	this IRandomSource<TGenerator> rng,
	long maxValue
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

rng  IRandomSource<TGenerator>
 
maxValue  Int64
The exclusive upper bound of the random number to be generated.

Type Parameters

TGenerator

Return Value

Int64
A 64-bit signed integer that is greater than or equal to 0, and less than 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).

NextInt64(IRandomSource, Int64, Int64)

Returns a random 64-bit integer that is within a specified range.
C#
public static long NextInt64(
	this IRandomSource rng,
	long minValue,
	long maxValue
)

Parameters

rng  IRandomSource
 
minValue  Int64
The inclusive lower bound of the random number returned.
maxValue  Int64
The exclusive upper bound of the random number returned.

Return Value

Int64
A 64-bit signed integer greater than or equal to minValue and less than 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).

NextInt64<TGenerator>(IRandomSource<TGenerator>, Int64, Int64)

Returns a random 64-bit integer that is within a specified range.
C#
public static long NextInt64<TGenerator>(
	this IRandomSource<TGenerator> rng,
	long minValue,
	long maxValue
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

rng  IRandomSource<TGenerator>
 
minValue  Int64
The inclusive lower bound of the random number returned.
maxValue  Int64
The exclusive upper bound of the random number returned.

Type Parameters

TGenerator

Return Value

Int64
A 64-bit signed integer greater than or equal to minValue and less than 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