1st call to rand(1.0)
generates predictable values < 1e-4 for seeds in 0..<26844, unlike C++, python, D, ...
#17467
Labels
Example
this shows that whatever (small) seed is picked, the 1st call to rand() gives a predictably small value < 1e-4, ie, skews the distribution.
This is a bug, other languages don't have this issue:
nim: fails
by fail, I mean it produces skewed results
(see example above)
python: works
prints:
D: works
prints:
C++ works
prints:
Additional Information
1.5.1 d6a1602
links
https://stackoverflow.com/questions/19665818/generate-random-numbers-using-c11-random-library
https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful
this is also related to an issue I had previously raised: #8589
The text was updated successfully, but these errors were encountered: