Robert P. Ewing wrote:
I've seen some discussion about random number generators here recently. I came across a quite good one (this being something I use extensively in my work), and thought I'd share it. It is written up in ACM Transactions on Modeling and Computer Simulation 8(1) 3-30, 1990. Supposedly it has a period of -1 + 2^19937. The original was in C; this translation returns the same values as the original. It is called the Mersenne Twister.
Fine. If we want to use it in GPC, we have to be sure about copyright and patent issues. Is this algorithm free of patents?
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License [...]
Was this the license of the original C code, too?
LI = __longlong__ integer; UL = __unsigned__ LI; {define 64-bit unsigned integer}
BTW, UL can be defined in a more readable way as `LongCard' now -- or `Cardinal (64)' if you want it to be exactly 64 bits wide, regardless of the word size of the target platform.
Frank
-- Frank Heckenbach, frank@fjf.gnu.de http://fjf.gnu.de/ PGP and GPG keys: http://fjf.gnu.de/plan