Bug 17862 – std.random.XorshiftEngine.min is wrong when bits == 32

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-09-27T06:42:34Z
Last change time
2018-03-23T00:28:52Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2017-09-27T06:42:34Z
XorshiftEngine.min is defined as 0 regardless of template parameters but an XorshiftEngine cannot produce a value of zero if its internal state has the same number of bits as the output element type.
Comment #1 by razvan.nitu1305 — 2017-10-03T06:05:05Z
Comment #2 by github-bugzilla — 2018-03-23T00:28:52Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/fa9215198226a1377fcb06ab2051319e3710b72a Fix Issue 17862 - std.random.XorshiftEngine.min is wrong when bits == 32 XorshiftEngine.min is defined as 0 regardless of template parameters but an XorshiftEngine cannot produce a value of zero if its internal state has the same number of bits as the output element type. https://github.com/dlang/phobos/commit/cc256d8dc93ffe3d1e5149b3438b60aa8d01cd87 Merge pull request #5746 from n8sh/xorshift-fix Fix Issue 17862 - std.random.XorshiftEngine.min is wrong when bits == 32 merged-on-behalf-of: Andrei Alexandrescu <[email protected]>