D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3224 - std.random documentation bugs
Summary: std.random documentation bugs
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords: spec
Depends on:
Blocks:
 
Reported: 2009-08-03 23:46 UTC by Kazuhiro Inaba
Modified: 2015-06-09 05:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kazuhiro Inaba 2009-08-03 23:46:09 UTC
> struct LinearCongruentialEngine(UIntType,UIntType a,UIntType c,UIntType m);
>> bool empty;
>>> Always true (random generators are infinite ranges).

should be "Always false"

> alias MinstdRand0; 
> alias MinstdRand;
>> Example:
>>> // seed with a constant
>>> auto rnd0 = MinstdRand0(1);
>>> auto n = rnd0.popFront; // same for each run
>>> // Seed with an unpredictable value
>>> rnd0.seed(unpredictableSeed);
>>> n = rnd0.popFront; // different across runs

should call .front, instead of .popFront (twice).