Skip to content

function random_uniform(random_state &) random

template <f_class T, size_t N>
KFR_INTRINSIC vec<T, N> random_uniform(random_state& state)

Generates a vector of uniformly distributed floating-point numbers in [0.0, 1.0).

This is derived by generating mantissas in [1.0, 2.0) and subtracting 1.0.

Template parameters
T Floating-point type (f32 or f64).
N Number of random floats to generate.
Parameters
state Reference to the random number generator state.
Returns
Vector of N floats in the range [0.0, 1.0).

Defined at base/random.hpp:71