GenerateFloat - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

RandomTools[MersenneTwister]

 GenerateFloat
 Generate a float using the Mersenne Twister Generator

 Calling Sequence GenerateFloat( opt1, opt2, ... )

Parameters

 opt1, opt2, ... - (optional) argument of the form option=value where option is digits

Description

 • The GenerateFloat command outputs a pseudo-random float uniformly distributed in [0,1), generated using the MersenneTwister algorithm.
 • The following optional arguments are supported. They are input as equations in any order.
 • digits=integer
 The digits argument specifies how many random digits should be returned.  If not specified, the current value of Digits is used.

Examples

 > $\mathrm{with}\left({\mathrm{RandomTools}}_{\mathrm{MersenneTwister}}\right)$
 $\left[{\mathrm{GenerateData}}{,}{\mathrm{GenerateFloat}}{,}{\mathrm{GenerateFloat64}}{,}{\mathrm{GenerateInteger}}{,}{\mathrm{GenerateInteger32}}{,}{\mathrm{GenerateUnsignedInt32}}{,}{\mathrm{GetState}}{,}{\mathrm{NewGenerator}}{,}{\mathrm{SetState}}\right]$ (1)
 > $\mathrm{GenerateFloat}\left(\right)$
 ${0.0581869302}$ (2)
 > $\mathrm{GenerateFloat}\left(\right)$
 ${0.4161255391}$ (3)
 > $\mathrm{seq}\left(\mathrm{GenerateFloat}\left(\right),i=1..5\right)$
 ${0.5244301281}{,}{0.9913501995}{,}{0.0809094426}{,}{0.8451185402}{,}{0.7412421905}$ (4)
 > $\mathrm{Digits}≔2:$
 > $\mathrm{seq}\left(\mathrm{GenerateFloat}\left(\right),i=1..5\right)$
 ${0.51}{,}{0.55}{,}{0.42}{,}{0.82}{,}{0.24}$ (5)
 > $\mathrm{seq}\left(\mathrm{GenerateFloat}\left(\mathrm{digits}=20\right),i=1..5\right)$
 ${0.33209313151200927547}{,}{0.73875216008903953457}{,}{0.53785826994734729223}{,}{0.34650929376604015531}{,}{0.12096280801357139130}$ (6)