diff options
author | Guido van Rossum <guido@python.org> | 1997-04-03 22:41:49 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-04-03 22:41:49 (GMT) |
commit | 571391b963058d5071a5372a4e55cb20c5476622 (patch) | |
tree | 263330f7ec90621008ae3a6426e284d1dd73805b /Doc/librand.tex | |
parent | 6191551ad6b122d49878843cb2aab8070f10c180 (diff) | |
download | cpython-571391b963058d5071a5372a4e55cb20c5476622.zip cpython-571391b963058d5071a5372a4e55cb20c5476622.tar.gz cpython-571391b963058d5071a5372a4e55cb20c5476622.tar.bz2 |
New stuff by AMK.
Diffstat (limited to 'Doc/librand.tex')
-rw-r--r-- | Doc/librand.tex | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Doc/librand.tex b/Doc/librand.tex index 4991e59..5a4df3e 100644 --- a/Doc/librand.tex +++ b/Doc/librand.tex @@ -1,21 +1,22 @@ \section{Standard Module \sectcode{rand}} +\stmodindex{rand} -\stmodindex{rand} This module implements a pseudo-random number -generator with an interface similar to \code{rand()} in C\@. It defines -the following functions: +The \code{rand} module simulates the C library's \code{rand()} +interface, though the results aren't necessarily compatible with any +given library's implementation. While still supported for +compatibility, the \code{rand} module is now considered obsolete; if +possible, use the \code{whrandom} module instead. -\renewcommand{\indexsubitem}{(in module rand)} -\begin{funcdesc}{rand}{} -Returns an integer random number in the range [0 ... 32768). +\begin{funcdesc}{choice}{seq} +Returns a random element from the sequence \var{seq}. \end{funcdesc} -\begin{funcdesc}{choice}{s} -Returns a random element from the sequence (string, tuple or list) -\var{s}. +\begin{funcdesc}{rand}{} +Return a random integer between 0 and 32767, inclusive. \end{funcdesc} \begin{funcdesc}{srand}{seed} -Initializes the random number generator with the given integral seed. -When the module is first imported, the random number is initialized with -the current time. +Set a starting seed value for the random number generator; \var{seed} +can be an arbitrary integer. \end{funcdesc} + |