std::rand() * std::rand() may or may not suffer from integer overflow depending on RAND_MAX. On Linux where RAND_MAX is usually 2^31-1, overflow almost always occurs (> 99.99% of the time) and this results in very different results (50% of values are negative) to windows where RAND_MAX is 2^15 (all positive values and smaller values in general). Not sure about OSX.
I guess this is not intentional. Ideally, once would use the same RNG on every platform. I don't know if the 50% negative values is a "feature" or not.
The text was updated successfully, but these errors were encountered:
I kind of got blocked when thinking about a PR because it seemed like making it deterministic across platforms would also be a good goal and <random> is kind of awkward since IIRC it has no good cross-plat RNGs, so I was like bleh.