How to generate a random number from system clock as seed

Nick Treleaven nick at geany.org
Sat Jun 8 20:53:02 UTC 2024


On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
> rng is an optional parameter, `uniform(0,100).writeln;` alone 
> works; the docs not telling you that is really bad

They do tell you:

> urng 	(optional) random number generator to use; if not 
> specified, defaults to rndGen

That overload is used in the 2nd example.

https://dlang.org/phobos/std_random.html#.uniform



More information about the Digitalmars-d-learn mailing list