This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/14993] [gfortran] RAN (extension) intrinsic/function not supported
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2004 22:04:51 -0000
- Subject: [Bug fortran/14993] [gfortran] RAN (extension) intrinsic/function not supported
- References: <20040417154917.14993.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-30 22:04 -------
According to the URL which I gave:
RAN stores a value in ISEED and uses it later to calculate the next
random number. RAN uses the following algorithm to calculate the value
and update the seed:
SEED = MOD(69069 * SEED + 1,2 ** 32)
SEED is a 32-bit number whose high-order 24 bits are converted to a
floating-point number and stored in Y. RAN returns Y and stores the new
seed in ISEED.
Which is slightly different than what you implemented,
rand_seed = GFC_RAND_A * rand_seed % GFC_RAND_M; what you implemented
what it says is the defintion:
SEED = (69069 * SEED + 1)%(2 ** 32)
I think my example was just to show RAN was not implemented as I was trying to compile someone's
else code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14993