RandomSample with specified random number generator

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sun Jun 17 10:31:09 PDT 2012


On 17/06/12 17:51, Joseph Rushton Wakeling wrote:
> On 17/06/12 17:08, Artur Skawina wrote:
>> Now the result is:
>>
>> [0, 7568, 7476, 0, 7494, 7500, 7461, 7504, 7527, 7470]
>>
>> ie still not quite what you'd expect...
>
> If you've got time, you might like to pull from my master branch:
> https://github.com/WebDrake/phobos
>
> ... and check if the same bug arises. I made exactly this kind of test.

I've compiled your test against my code and get out, on 4 different runs:

[5984, 5950, 6046, 6020, 5977, 5839, 5936, 6032, 6137, 6079]
[6075, 5904, 5993, 6027, 6076, 5987, 6012, 6013, 5884, 6029]
[6089, 5964, 6006, 5920, 5937, 5997, 6034, 6019, 6038, 5996]
[5975, 5916, 6087, 6026, 6068, 5938, 5972, 5937, 5966, 6115]

... which seems in the ballpark.

However, a disturbing fact: if instead of compiling, I run with rdmd, I get out:

[0, 0, 20000, 5643, 5800, 5749, 5699, 5655, 5664, 5790]

I can't work out why the compiled result would be different from the output of 
rdmd, as I recompiled not only Phobos but also rdmd itself.  Perhaps that it's 
looking in /usr/include/ when building instead of /usr/local/include/ ... ?


More information about the Digitalmars-d mailing list