[Issue 17847] Properly sanitize seeds for Park–Miller engines
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 25 13:31:13 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17847
--- Comment #2 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/fd2e5ba03c2c1304dd516a32e2659c3ed01c1936
Fix Issue 17847 - Properly sanitize seeds for Park–Miller engines
As in XorshiftEngine, sanitizing the seed is more useful than throwing
an exception. The original check was broken because it checked the seed
before taking the modulus. Making this change allows unpredictableSeed
to be marked nothrow and @nogc.
https://github.com/dlang/phobos/commit/218434f4b72bd4b8616214a615fe8cd433c6efe0
Merge pull request #5743 from n8sh/fix-random-lcg
Fix Issue 17847 - Properly sanitize seeds for Park–Miller engines
merged-on-behalf-of: Dmitry Olshansky <dmitry at olshansky.me>
--
More information about the Digitalmars-d-bugs
mailing list