uniform01

Generates a uniformly-distributed floating point number of type T in the range [0, 1). If no random number generator is specified, the default RNG rndGen will be used as the source of randomness.

uniform01 offers a faster generation of random variates than the equivalent uniform!"[)"(0.0, 1.0) and so may be preferred for some applications.

  1. T uniform01()
  2. T uniform01(UniformRNG rng)
    T
    uniform01
    (
    T = double
    UniformRNG
    )
    (
    UniformRNG rng
    )
    if (
    isFloatingPoint!T &&
    isUniformRNG!UniformRNG
    )
    out (result) { assert (0 <= result); assert (result < 1); }

Meta