std.random - D Programming Language - Digital Mars

D Programming Language 1.0

- Comments
- D
- Search
- Home

Last update Wed Sep 2 00:11:32 2009

# std.random

void rand_seed(uint seed, uint index);
  The random number generator is seeded at program startup with a random value. This ensures that each program generates a different sequence of random numbers. To generate a repeatable sequence, use rand_seed() to start the sequence. seed and index start it, and each successive value increments index. This means that the nth random number of the sequence can be directly generated by passing index + n to rand_seed().
  Note:
  This is more random, but slower, than C's rand() function. To use C's rand() instead, import std.c.stdlib.
uint rand();
  Get the next random number in sequence.
  BUGS:
  shares a global single state, not multithreaded

Copyright © 1999-2009 by Digital Mars, All Rights Reserved | Page generated by Ddoc.