number type.
random generator.
random generator value. Returns; random value.
import std.math : isClose; import std.random : isUniformRNG; struct Rng { @property real front() const @nogc nothrow pure @safe scope { return 0.5; } @property bool empty() const @nogc nothrow pure @safe scope { return false; } void popFront() @nogc nothrow pure @safe scope {} enum isUniformRandom = true; enum max = 1.0; enum min = 0.0; } static assert(isUniformRNG!Rng); auto rng = Rng(); immutable result1 = gaussianDistributionRandom!real(rng); assert(result1.isClose(cast(real) -0x9.6b55f2257e218fep-3)); immutable result2 = gaussianDistributionRandom!real(rng); assert(result2.isClose(cast(real) -0x9.6b55f2257e218fep-3));
Generate Gaussian distribution random number.