From 1c462ac694a957ec1355c2e0875b54705132c8eb Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Tue, 10 Dec 2002 13:50:40 +0000 Subject: [PATCH] Improve generation of pseudo-random integers. (#99720, Morten Welinder 2002-12-10 Sebastian Wilhelmi * glib/grand.c (g_rand_int_range): Improve generation of pseudo-random integers. (#99720, Morten Welinder ) * README.in, docs/reference/glib/running.sgml, docs/reference/glib/tmpl/random_numbers.sgml, docs/reference/glib/changes.sgml: Added notes about the new algorithm. 2CVS: ---------------------------------------------------------------------- --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-12 | 10 ++++++++++ ChangeLog.pre-2-2 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ README.in | 15 ++++++++++----- docs/reference/glib/changes.sgml | 16 ++++++++++------ docs/reference/glib/running.sgml | 11 ++++++----- 10 files changed, 96 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f1201ffd..272b36da1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6f1201ffd..272b36da1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2002-12-10 Sebastian Wilhelmi + + * glib/grand.c (g_rand_int_range): Improve generation of + pseudo-random integers. (#99720, Morten Welinder ) + + * README.in, docs/reference/glib/running.sgml, + docs/reference/glib/tmpl/random_numbers.sgml, + docs/reference/glib/changes.sgml: Added notes about the new + algorithm. + 2002-12-09 Sebastian Wilhelmi * configure.in: use 0 instead of $defattr, as it isn't defined diff --git a/README.in b/README.in index 856bab41f..56ab9aa7c 100644 --- a/README.in +++ b/README.in @@ -34,11 +34,16 @@ Notes about GLib-2.2.0 http://www.math.keio.ac.jp/~matumoto/emt.html - The original seeding algorithm, as found in GLib-2.0.x, can be used - instead of the new one by setting the environment variable - G_RANDOM_VERSION to the value of "2.0". Use the GLib-2.0 algorithm - only if you have sequences of numbers generated with Glib-2.0 that - you need to reproduce exactly. + Also the pseudo-random integers generated by g_rand_int_range and + g_random_int_range will have a slightly better equal distribution + with the new version of GLib. + + The original algorithms, as found in GLib-2.0.x, can be used instead + of the new ones by setting the environment variable G_RANDOM_VERSION + to the value of "2.0". + + Use the GLib-2.0 algorithms only if you have sequences of numbers + generated with Glib-2.0 that you need to reproduce exactly. How to report bugs ================== diff --git a/docs/reference/glib/changes.sgml b/docs/reference/glib/changes.sgml index ae8f5035d..1dbb74a44 100644 --- a/docs/reference/glib/changes.sgml +++ b/docs/reference/glib/changes.sgml @@ -23,7 +23,10 @@ Incompatible changes made between successing versions of GLib GLib changed the seeding algorithm for the pseudo-random number generator Mersenne Twister, as used by GRand and GRandom. This was necessary, because some -seeds would yield very bad pseudo-random streams. +seeds would yield very bad pseudo-random streams. Also the +pseudo-random integers generated by +g_rand*_int_range() will have a +slightly better equal distribution with the new version of GLib. @@ -33,12 +36,13 @@ url="http://www.math.keio.ac.jp/~matumoto/emt.html">http://www.math.keio.ac.jp/~ -The original seeding algorithm, as found in GLib 2.0.x, can be used -instead of the new one by setting the environment variable -G_RANDOM_VERSION to the value of '2.0'. Use the -GLib-2.0 algorithm only if you have sequences of numbers generated -with Glib-2.0 that you need to reproduce exactly. +The original seeding and generation algorithms, as found in GLib +2.0.x, can be used instead of the new ones by setting the environment +variable G_RANDOM_VERSION to the value of '2.0'. Use +the GLib-2.0 algorithms only if you have sequences of numbers generated +with Glib-2.0 that you need to reproduce exactly. + diff --git a/docs/reference/glib/running.sgml b/docs/reference/glib/running.sgml index b933883c0..4335b4f27 100644 --- a/docs/reference/glib/running.sgml +++ b/docs/reference/glib/running.sgml @@ -67,12 +67,13 @@ variables like LANG, PATH or HOME. If this environment variable is set to '2.0', the outdated - pseudo-random number seeding algorithm from GLib-2.0 is used - instead of the new better one. Use the GLib-2.0 algorithm only if - you have sequences of numbers generated with Glib-2.0 that you - need to reproduce exactly. - + pseudo-random number seeding and generation algorithms from + GLib-2.0 are used instead of the new better ones. Use the GLib-2.0 + algorithms only if you have sequences of numbers generated with + Glib-2.0 that you need to reproduce exactly. + +