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

◆ Genrand64Int64()

Function Genrand64Int64 ( )

Uniform random numbers (unsigned 64 bit integer random numbers) (64 bit Mersenne Twister)

Purpose
Generates uniformly distributed pseudo random numbers by 64 bit Mersenne Twister (MT19937-64).
Returns
LongLong
Unsigned 64 bit integer pseudo random number (In VBA, it is handled as the signed 64 bit integer (LongLong type)).
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 ten 64 bit integer pseudo random numbers using 5489 as the seed value for initialization.
Sub Ex_Genrand64Int64()
Dim Seed As LongLong, I As Long
Seed = 5489
Call InitGenrand64(Seed)
For I = 1 To 10
Debug.Print Genrand64Int64()
Next
End Sub
Example Results
-3932459287431434586
4620546740167642908
-5337173792191653896
-983805426561117294
355488278567739596
7469126240319926998
4635995468481642529
418970542659199878
-8842573084457035060
6358044926049913402