Fix some markup breakage that prevented formatting; re-wrapped a couple of
wide paragraphs.
This commit is contained in:
parent
c2e35e6f37
commit
d0946da701
|
@ -70,16 +70,16 @@ def create_generators(num, delta, firstseed=None):
|
|||
gens = create_generators(10, 1000000)
|
||||
\end{verbatim}
|
||||
|
||||
That creates 10 distinct generators, which can be passed out to 10 distinct
|
||||
threads. The generators don't share state so can be called safely in
|
||||
parallel. So long as no thread calls its \code{g.random()} more than a
|
||||
million times (the second argument to \function{create_generators), the
|
||||
sequences seen by each thread will not overlap. The period of the
|
||||
underlying Wichmann-Hill generator limits how far this technique can be
|
||||
pushed.
|
||||
That creates 10 distinct generators, which can be passed out to 10
|
||||
distinct threads. The generators don't share state so can be called
|
||||
safely in parallel. So long as no thread calls its \code{g.random()}
|
||||
more than a million times (the second argument to
|
||||
\function{create_generators()}, the sequences seen by each thread will
|
||||
not overlap. The period of the underlying Wichmann-Hill generator
|
||||
limits how far this technique can be pushed.
|
||||
|
||||
Just for fun, note that since we know the period, \method{jumpahead()} can
|
||||
also be used to "move backward in time":
|
||||
Just for fun, note that since we know the period, \method{jumpahead()}
|
||||
can also be used to ``move backward in time:''
|
||||
|
||||
\begin{verbatim}
|
||||
>>> g = Random(42) # arbitrary
|
||||
|
@ -100,7 +100,7 @@ Bookkeeping functions:
|
|||
current system time is also used to initialize the generator when the
|
||||
module is first imported.
|
||||
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.
|
||||
Distinct values between 0 and 27814431486575L inclusive are guaranteed
|
||||
to yield distinct internal states (this guarantee is specific to the
|
||||
|
|
Loading…
Reference in New Issue