Denis Koroskin wrote:
On Sat, 14 Feb 2009 14:04:36 +0300, Walter Bright <newshou...@digitalmars.com> wrote:

Andrei Alexandrescu wrote:
auto big = uniform(rng, uint.max / 2, uint.max);
 If the interval is open I can't generate uint.max.


auto big = uniform(rng, uint.max / 2 - 1, uint.max) + 1;

Yeah, but now about uniform(uint.min, uint.max)?


auto big = cast(uint)uniform(rng, cast(ulong)uint.min, cast(ulong)uint.max + 1);

Reply via email to