ddos:
auto numbers = iota(0,1).map!(_ => uniform(0.0,1.0)).array;
Better:
const numbers = 10_000.iota.map!(_ => uniform01).array;
auto nmin = numbers.reduce!((a,b) => min(a,b));
Better:
immutable nMin = numbers.reduce!min;
You can also combine both (untested):
immutable nMinMax =
i wrote a histogram algorithm
i tried to write it the shortest and most "D" way possible ...
please tell me if you see any simpler way of doing it
is there a simpler way of getting the minimum of a range? (by
intuition i tried range.min)
auto numbers = iota(0,1).map!(_ => uniform(0.0,1.