http://d.puremagic.com/issues/show_bug.cgi?id=8314
Summary: randomSample primes with constant Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: d...@dawgfoto.de --- Comment #0 from d...@dawgfoto.de 2012-06-27 23:35:08 PDT --- import std.random, std.range, std.stdio; void main() { foreach (_; 0 .. 100) { immutable seed = unpredictableSeed(); writeln(seed, " => ", randomSample(iota(100), 1, Random(seed)).front); } } -------- The random generator is assigned to the Range only after it was primed and the default constructed random generator always returns the same first value. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------