diff options
author | Guido van Rossum <guido@python.org> | 1997-04-03 22:41:49 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-04-03 22:41:49 +0000 |
commit | e628f5b65f15abcd05197338dd935e3274f5877d (patch) | |
tree | d41009d2ad03ff1f5206e8565857285416b53e56 /Doc/lib/librand.tex | |
parent | 8cc4e4fc0ac124ed2d9f8dfbb254d0778cfe9266 (diff) | |
download | cpython-e628f5b65f15abcd05197338dd935e3274f5877d.tar.gz |
New stuff by AMK.
Diffstat (limited to 'Doc/lib/librand.tex')
-rw-r--r-- | Doc/lib/librand.tex | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Doc/lib/librand.tex b/Doc/lib/librand.tex index 4991e5986f..5a4df3eb50 100644 --- a/Doc/lib/librand.tex +++ b/Doc/lib/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} + |