RandomSource<TGenerator>.UncachedFacade.Next Method

Returns a random 31-bit non-negative integer, consuming a full 64-bit value.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public int Next()

Return Value

Int32
A 32-bit signed integer in the range [0, MaxValue].

Remarks

This method consumes ONE full 64-bit value from the underlying RNG, shifts right by 33 bits (to get 31 bits), and casts to Int32. This produces a non-negative 31-bit integer.

  Caution

This method is less efficient than Next() because it consumes a full 64-bit value for each 31-bit result. Use only when full-width consumption is required.

See Also