This module implements a Wichmann-Hill pseudo-random number generator
class that is also named whrandom. Instances of the
whrandom class conform to the Random Number Generator
interface described in section
0
, the
seed will be computed from the current system time. If one or two
of the parameters are 0
, but not all three, the zero values
are replaced by ones. This causes some apparently different seeds
to be equal, with the corresponding result on the pseudo-random
series produced by the generator.
a<=N<=b
.
a<=N<b
.
When imported, the whrandom module also creates an instance of
the whrandom class, and makes the methods of that instance
available at the module level. Therefore one can write either
N = whrandom.random()
or:
generator = whrandom.whrandom() N = generator.random()
Note that using separate instances of the generator leads to independent sequences of pseudo-random numbers.
See Also:
Wichmann, B. A. & Hill, I. D., ``Algorithm AS 183: An efficient and portable pseudo-random number generator'', Applied Statistics 31 (1982) 188-190.
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant