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

◆ Genrand64Int63()

Function Genrand64Int63 ( )

Uniform random numbers (unsigned 63 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 63 bit integer pseudo random number.
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 unsigned 63 bit integer pseudo random numbers using 5489 as the seed value for initialization.
Sub Ex_Genrand64Int63()
Dim Seed As LongLong, I As Long
Seed = 5489
Call InitGenrand64(Seed)
For I = 1 To 10
Debug.Print Genrand64Int63()
Next
End Sub
Example Results
7257142393139058515
2310273370083821454
6554785140758948860
8731469323574217161
177744139283869798
3734563120159963499
2317997734240821264
209485271329599939
4802085494626258278
3179022463024956701