Different random shuffles generated when compiled with gdc than with dmd

Joseph Rushton Wakeling via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 31 15:07:12 PDT 2014


On 31/05/14 23:22, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:
> It's due to the the updated uniform() provided in this pull request:
> https://github.com/D-Programming-Language/phobos/commit/fc48d56284f19bf171780554b63b4ae83808b894

You can see the effects in action by running e.g. the following D code:

//--------------------------------------------------------------
import std.algorithm, std.random, std.range, std.stdio;

void main()
{
     rndGen.seed(12);
     iota(0, 10).map!(a => uniform(0, 10 - a, rndGen)).writeln;
}
//--------------------------------------------------------------

... which corresponds to the underlying calls to uniform() found in the shuffle 
process.


More information about the Digitalmars-d-learn mailing list