This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/14993] [gfortran] RAN (extension) intrinsic/function not supported


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]