generating random numbers

James Blachly james.blachly at gmail.com
Mon Aug 10 12:08:49 UTC 2020


On 8/10/20 1:51 AM, Andy Balba wrote:
> generating random numbers using 
> https://dlang.org/library/std/random/uniform01.html
> 
> I find the example given in this section totally incomprehensible
> .. Can any help me answer two simple questions:
> How to generate a random floating number in range [0,1) ?
> How to set a seed value, prior to generating random values ?

Tangential: I also find mir-random [0] a very nice library that is easy 
to use and has no deps on D runtime, so can be used in Das Better C mode.

I think it is also a better random engine than phobos

[0] https://code.dlang.org/packages/mir-random


More information about the Digitalmars-d-learn mailing list