RandomSource<TGenerator>.UncachedFacade Structure

Provides uncached random number generation for 64-bit word RNGs.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public readonly struct UncachedFacade
Inheritance
Object  →  ValueType  →  RandomSource<TGenerator>.UncachedFacade

Remarks

The RandomSource<TGenerator>.UncachedFacade struct forces 64-bit RNGs to consume a full 64-bit value for each call, even when returning 32-bit or smaller types. This is less efficient but matches certain compatibility modes and reference implementations.

Consumption Pattern:

  • NextUInt32(): Consumes ONE 64-bit value, returns upper 32 bits
  • Next(): Consumes ONE 64-bit value, returns 31-bit signed int
  • NextSingle(): Consumes ONE 64-bit value, uses top 24 bits

  Important

This facade should only be used when full-width value consumption is explicitly required. For normal usage, the standard API is more efficient.

Methods

EqualsIndicates whether this instance and a specified object are equal.
(Inherited from ValueType)
GetHashCodeReturns the hash code for this instance.
(Inherited from ValueType)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Next Returns a random 31-bit non-negative integer, consuming a full 64-bit value.
NextSingle Returns a random single-precision floating-point number in [0, 1), consuming a full 64-bit value.
NextUInt32 Returns a random 32-bit unsigned integer, consuming a full 64-bit value.
ToStringReturns the fully qualified type name of this instance.
(Inherited from ValueType)

See Also