Mail Archives: djgpp/1994/11/03/13:12:08
From: Howard Kaikow <kaikow AT standards DOT com>
It might be more appropriate to have discussions of algorithms for math
functions and statistical functions, e.g., random number generators in the
newsgroup oriented towards those algorithms. The following come to mind:
Nobody in this discussion, excepting dliu and the person who mentioned
rand48(), not excepting myself, could possibly send our posts to a
*real* numerical analysis group and not get laughed at, for one thing.
Seriously, the "default" random number generator in GCC is trash.
That makes it worth discussing in this group what the problem is and
whether and how we should fix it, especially since there seems to be
no consensus among GCC implementors on this issue.
Based on the discussion so far, I would suggest
(1) many studies depend or at least are assisted by the use of a
common sequence of pseudo-random values. Obviously, there is no
standard for this, since different GCC implementations give
different results. If possible, we should follow any
recommandations or standard practice among GCC implementations, so
that people suing the same seed and the same rand() function get
the same sequence.
(2) We should make random() and rand48() available if they aren't
already. If there is no consensus generator as in (1), we should
consider changing rand() to an alias for one of the better ones.
We may want to consider that anyway.
(3) Put references to proper use of pseudo-random generators in the
dox, and deprecate the use of the current rand().
Many thanks to dliu, the person who recommended rand48(), and Aaron
Ucko, three voices of sanity amidst the madding crowd.
--Steve
- Raw text -