randomArray

Returns random numbers from [low, high). The random numbers are uniformly distributed.

T[]
randomArray
(
T
)
(
T low
,,
ulong size
)

Parameters

low T

The beginning of the range of the distribution.

high T

The end of the range of the distribution.

size ulong

The size of the array.

Examples

double low = -100.0;
double high = 100.0;
ulong size = 20;

auto array = randomArray(low, high, size);
assert(array.length == size);
foreach(double e; array) {
    assert(low <= e && e < high);
}

Meta