normalFloats

Generate n numbers distributed N(mu, sigma^2)

F[]
normalFloats
(
F
)
(
ulong n
,
F mu
,)
if (
isFloatingPoint!F
)

Examples

import std.stdio : writeln;
const y = normalFloats!float(200, 3.14159, 1);
float tmp = 0;

foreach(g; y)
    tmp += g;
writeln(tmp / 200);

Meta