diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2021-10-05 12:18:34 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2021-10-05 12:18:34 +0200 |
commit | 65ceb4d647b5acc68365928ec0b64860a9b3f427 (patch) | |
tree | f46a346fda8bbbed9848f9687fca12f29534299d /rand | |
parent | abbd5da8950fedf650702bd38cbec322b5798557 (diff) | |
download | gmp-65ceb4d647b5acc68365928ec0b64860a9b3f427.tar.gz |
rand/randmts.c: Update a comment about seeds.
Diffstat (limited to 'rand')
-rw-r--r-- | rand/randmts.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rand/randmts.c b/rand/randmts.c index a6c5c0ba3..2b95a2ab9 100644 --- a/rand/randmts.c +++ b/rand/randmts.c @@ -102,6 +102,13 @@ mangle_seed (mpz_ptr r) with seeds 2^19937-20027, 2^19937-20026, ... the exact same sequences are obtained as with seeds 0, 1, etc.; it also means that seed -1 produces the same sequence as seed 2^19937-20028, etc. + + Moreover, c) is not guaranted, there are many seeds yielding to the + same sequence, because gcd (1074888996, 2^19937 - 20023 - 1) = 12. + E.g. x and x'=x*19^((2^19937-20023-1) / 12) mod (2^19937-20023), if + chosen as seed1, generate the same seed2, for every x. + Similarly x" can be obtained from x', obtaining 12 different + values. */ static void |