FPC has built-in pseudo-random number generator. There are (in System unit) three overloaded random functions exposed to public
(as we can see here).However, If I want to get pseudo-random Integer (32-bit sequence), I don't know how. The version of Random which returns integer takes a positive argument and returns a value between zero and this argument -- so the most I can get is 31-bit (if I pass MaxInt to the function).
Looking in sources, we can see that all these three functions internaly call function genrand_MT19937, which is not exposed to public (it is under implementation section of System unit).
If I understand well, this genrand_MT19937 function returns pseudo-random Longint. If I had access to this function, I could get pseudo-random 32-bit number. For 64-bit number I could use
(qword(cardinal(genrand_MT19937)) or ((qword(cardinal(genrand_MT19937)) shl 32)
Shouldn't we have access to this function? Seems to me that all three Random functions that we have exposed in system unit cut something from result of this original function.
Before I ask for this in bug tracker, I would like to discuss it here.