Updated 2007-11-10 21:26:55 by dkf

Purpose: Help with the math function rand.


The arg, which must be an integer, is used to reset the seed for the random number generator. Returns the first random number from that seed. Each interpreter has its own seed.

See also: rand.

The rand() and srand() functions are not cryptographically secure, and must not be used to generate one-time passwords or session keys. They are also probably not strong enough for Monte-Carlo simulation usage.

I don't find an srand section n man page - where does this come from? Is it specs for a function that is missing? Is it part of an existing package? If so, what package - and can we have a URL to its man page?

srand is a subfunction of expr, so you can read about it on http://purl.org/tcl/home/man/tcl8.4/TclCmd/expr.htm .