This function returns a random number.
Note: Use rand_seed to create a repeatable sequence of random numbers.
Example:
import std.stdio;
import std.random;
void main()
{
for(int i = 1; i <= 5; i++)
writefln("rand() returns %d", rand());
}
|
Output could be:
rand() returns 2018360261
rand() returns 4236961988
rand() returns 1858414318
rand() returns 2437703434
rand() returns 1482694331 |
See also:
rand_seed
|