RandomTools[MersenneTwister]
GenerateInteger
Generate an integer using the Mersenne Twister 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 MersenneTwister algorithm.
When generating a large number of random integers it is faster to create a generating procedure by calling NewGenerator than to call GenerateInteger.
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 is chosen from that range. If the value of the range argument is an integer, then the integer is chosen from the range 0..value-1. The default value is 1000000000000.
with⁡RandomToolsMersenneTwister
GenerateData,GenerateFloat,GenerateFloat64,GenerateInteger,GenerateInteger32,GenerateUnsignedInt32,GetState,NewGenerator,SetState
GenerateInteger⁡
395718860534
193139816415
seq⁡GenerateInteger⁡,i=1..10
22424170465,800187484459,427552056869,842622684442,412286285840,996417214180,386408307450,694607189265,773012980023,730616292946
GenerateInteger⁡range=1000..2000
1024
1601
seq⁡GenerateInteger⁡range=1000..2000,i=1..5
1604,1827,1476,1397,1049
seq⁡Float⁡GenerateInteger⁡range=1010,−10,i=1..5
0.8415955883,0.2816384844,0.8743315087,0.3646982597,0.4011470445
See Also
rand
RandomTools
RandomTools[BlumBlumShub]
RandomTools[Generate]
RandomTools[LinearCongruence]
RandomTools[MersenneTwister][GenerateFloat64]
RandomTools[MersenneTwister][GenerateFloat]
RandomTools[MersenneTwister][GenerateInteger32]
RandomTools[MersenneTwister][GenerateUnsignedInt32]
RandomTools[MersenneTwister][NewGenerator]
RandomTools[QuadraticCongruence]
Download Help Document