Bug 2865 – RandomCover not random.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-20T16:32:00Z
Last change time
2015-06-09T01:26:25Z
Assigned to
bugzilla
Creator
dsimcha

Attachments

IDFilenameSummaryContent-TypeSize
330random.patchFix.text/plain130

Comments

Comment #0 by dsimcha — 2009-04-20T16:32:37Z
RandomCover is not actually random because the selection of the next element to visit goes up to index k - 2 instead of element k - 1, where k = _input.length - _alreadyChosen. I'm assuming this was because someone forgot that the default bounds of uniform are [), not []. Patch to follow momentarily.
Comment #1 by dsimcha — 2009-04-20T16:33:08Z
Created attachment 330 Fix.
Comment #2 by dsimcha — 2009-05-13T13:47:29Z
This is clearly fixed in 2.030 even though it's not noted in the changelog. The change was made in the relevant code, and RandomCover passes basic statistical tests for uniformity over the permutation space now. Please update the changelog to reflect this.
Comment #3 by andrei — 2009-07-06T10:17:26Z
Apologies. I'm not sure how this change escaped from the changelog, I diff and look at each file before the release. Thanks for the patch!
Comment #4 by bugzilla — 2009-07-09T02:55:08Z
Fixed dmd 2.031