RandomSource<TGenerator>.UncachedFacade.NextSingle Method

Returns a random single-precision floating-point number in [0, 1), consuming a full 64-bit value.

Definition

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

Return Value

Single
A single-precision floating-point number in the range [0.0f, 1.0f).

Remarks

This method consumes ONE full 64-bit value from the underlying RNG, extracts the top 24 bits (required for single-precision mantissa), and converts to a float in [0, 1) using the standard formula: (x >> 40) * (1.0f / (1u << 24)).

  Caution

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

See Also