Fix some markup breakage that prevented formatting; re-wrapped a couple of

wide paragraphs.
This commit is contained in:
Fred Drake 2001-02-01 15:53:24 +00:00
parent c2e35e6f37
commit d0946da701
1 changed files with 10 additions and 10 deletions

View File

@ -70,16 +70,16 @@ def create_generators(num, delta, firstseed=None):
gens = create_generators(10, 1000000) gens = create_generators(10, 1000000)
\end{verbatim} \end{verbatim}
That creates 10 distinct generators, which can be passed out to 10 distinct That creates 10 distinct generators, which can be passed out to 10
threads. The generators don't share state so can be called safely in distinct threads. The generators don't share state so can be called
parallel. So long as no thread calls its \code{g.random()} more than a safely in parallel. So long as no thread calls its \code{g.random()}
million times (the second argument to \function{create_generators), the more than a million times (the second argument to
sequences seen by each thread will not overlap. The period of the \function{create_generators()}, the sequences seen by each thread will
underlying Wichmann-Hill generator limits how far this technique can be not overlap. The period of the underlying Wichmann-Hill generator
pushed. limits how far this technique can be pushed.
Just for fun, note that since we know the period, \method{jumpahead()} can Just for fun, note that since we know the period, \method{jumpahead()}
also be used to "move backward in time": can also be used to ``move backward in time:''
\begin{verbatim} \begin{verbatim}
>>> g = Random(42) # arbitrary >>> g = Random(42) # arbitrary
@ -100,7 +100,7 @@ Bookkeeping functions:
current system time is also used to initialize the generator when the current system time is also used to initialize the generator when the
module is first imported. module is first imported.
If \var(x) is not \code{None} or an int or long, If \var(x) is not \code{None} or an int or long,
\code{hash(\var{x})) is used instead. \code{hash(\var{x})} is used instead.
If \var{x} is an int or long, \var{x} is used directly. If \var{x} is an int or long, \var{x} is used directly.
Distinct values between 0 and 27814431486575L inclusive are guaranteed Distinct values between 0 and 27814431486575L inclusive are guaranteed
to yield distinct internal states (this guarantee is specific to the to yield distinct internal states (this guarantee is specific to the