GenerateInteger - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


RandomTools[LinearCongruence]

  

GenerateInteger

  

Generate an integer using the Linear Congruence Generator

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

GenerateInteger( opt1, opt2, ... )

Parameters

opt1, opt2, ...

-

(optional) argument of the form option=value where option is range

Description

• 

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.

Examples

withRandomToolsLinearCongruence

GenerateInteger,GetState,NewGenerator,SetState

(1)

GenerateInteger

427419669081

(2)

GenerateInteger

321110693270

(3)

seqGenerateInteger,i=1..10

343633073697,474256143563,558458718976,746753830538,32062222085,722974121768,604305613921,745580037409,259811952655,310075487163

(4)

GenerateIntegerrange=1000..2000

1350

(5)

GenerateIntegerrange=1000..2000

1697

(6)

seqGenerateIntegerrange=1000..2000,i=1..5

1445,1791,1567,1736,1300

(7)

seqFloatGenerateIntegerrange=1010,10,i=1..5

0.0624947349,0.1053530086,0.6486307198,0.5590763466,0.9392673709

(8)

See Also

rand

RandomTools

RandomTools[BlumBlumShub]

RandomTools[Generate]

RandomTools[LinearCongruence]

RandomTools[LinearCongruence][NewGenerator]

RandomTools[QuadraticCongruence]