RandomTools[LinearCongruence]
GenerateInteger
Generate an integer using the Linear Congruence Generator
Calling Sequence
Parameters
Description
Examples
GenerateInteger( opt1, opt2, ... )
opt1, opt2, ...
-
(optional) argument of the form option=value where option is range
The GenerateInteger command outputs a pseudo-random integer, generated using the LinearCongruence algorithm.
When generating a large number of random integers it is faster to create a generating procedure by calling NewGenerator than to call GenerateInteger multiple times.
The following optional arguments are supported. They are input as equations in any order.
range=integer..integer or integer
If the value of the range argument is a range, then the integer will be chosen from that range. If the value of the range argument is an integer, then the integer will be take from [0,range). The default value is 1000000000000.
with⁡RandomToolsLinearCongruence
GenerateInteger,GetState,NewGenerator,SetState
GenerateInteger⁡
427419669081
321110693270
seq⁡GenerateInteger⁡,i=1..10
343633073697,474256143563,558458718976,746753830538,32062222085,722974121768,604305613921,745580037409,259811952655,310075487163
GenerateInteger⁡range=1000..2000
1350
1697
seq⁡GenerateInteger⁡range=1000..2000,i=1..5
1445,1791,1567,1736,1300
seq⁡Float⁡GenerateInteger⁡range=1010,−10,i=1..5
0.0624947349,0.1053530086,0.6486307198,0.5590763466,0.9392673709
See Also
rand
RandomTools
RandomTools[BlumBlumShub]
RandomTools[Generate]
RandomTools[LinearCongruence][NewGenerator]
RandomTools[QuadraticCongruence]
Download Help Document