XLPack 6.1
Excel VBA Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ Genrand64Real1()

Function Genrand64Real1 ( )

Double precision real random number in [0, 1] (64 bit Mersenne Twister)

Purpose
Generates uniformly distributed pseudo random numbers by 64 bit Mersenne Twister (MT19937-64).
Returns
Double
Double precision real pseudo random number on [0, 1].
Note
This routine must be initialized by InitGenrand64() or InitByArray64() before generating random numbers. If this routine is called without an initialization, it will be automatically initialized by the default seed 5489.
Note
This routine cannot be used on the 32 bit Excel.
Reference
Mersenne Twister Home Page
Example Program
Generate 10 real pseudo random numbers in [0, 1] using 5489 as the seed value for initialization.
Sub Ex_Genrand64Real1()
Dim Seed As LongLong, I As Long
Seed = 5489
Call InitGenrand64(Seed)
For I = 1 To 10
Debug.Print Genrand64Real1()
Next
End Sub
Example Results
0.786820954867802
0.250480340688029
0.710671228978656
0.946667800960971
1.92710581958138E-02
0.404902144816168
0.251317817928038
2.27124386279267E-02
0.520643152573492
0.344670306079188