Re: Fix random_sample_n and random_shuffle when RAND_MAX is small

2019-01-20 Thread Giovanni Bajo
Il giorno mar 15 gen 2019 alle ore 03:38 Jonathan Wakely ha scritto: > On 12/12/18 22:31 +0100, Giovanni Bajo wrote: > >Hello, > > > >we hit a bug today while cross-compiling a C++ program with mingw32: > >if random_shuffle or random_sample_n are called with a sequence of > >elements whose

Re: Fix random_sample_n and random_shuffle when RAND_MAX is small

2019-01-14 Thread Jonathan Wakely
On 12/12/18 22:31 +0100, Giovanni Bajo wrote: Hello, we hit a bug today while cross-compiling a C++ program with mingw32: if random_shuffle or random_sample_n are called with a sequence of elements whose length is higher than RAND_MAX, the functions don't behave as expected because they ignore

Fix random_sample_n and random_shuffle when RAND_MAX is small

2018-12-12 Thread Giovanni Bajo
Hello, we hit a bug today while cross-compiling a C++ program with mingw32: if random_shuffle or random_sample_n are called with a sequence of elements whose length is higher than RAND_MAX, the functions don't behave as expected because they ignore elements beyond RAND_MAX. This does not happen