This is the mail archive of the gcc@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]

Re: GNU Fortran inquiry


You are more likely to receive replies on the gcc-help list or
comp.lang.fortran, if you wish more detailed suggestions.  Yes, a given seed
should reproduce the same pseudo-random sequence.  As you suggest, a typical
strategy for varying the seed is to calculate it from the time of day.  For
example, on most g77 and other Fortran implementations, the time in
milliseconds since midnight may be obtained from the hour, minute, second,
and millisecond fields returned by 'call get_time_of_day()'.  g77's subset
of the standard get_time_of_day is documented in 'info g77.'
----- Original Message -----
From: "Isabelle Descamps" <descamps@ensm-douai.fr>
To: <gcc@gcc.gnu.org>
Sent: Tuesday, November 27, 2001 9:00 AM
Subject: GNU Fortran inquiry


> Dear Sir,
>
> I send you this mail because I would like to get help with GNU Fortran,
> particularly with intrinsic functions and subroutines.
> In fact, I 'm doing a model in fortran langage.
> I must use a random generator.
> So, I use the following intrinsic function : rand(seed).
> Netherveless, a given seed always produces the same sequence of values
from
> rand.
> I would like to know if it is possible to use a constant to seed with the
> current time.
>
> I'll thank you
> Isabelle Descamps
>
> École des Mines de Douai
> Département Énergétique industrielle
> 941, rue Charles Bourseul
> BP 838
> 59508 DOUAI Cedex
> tél. : 03 27 71 23 86
> Mail : descamps@ensm-douai.fr
> Visitez notre site : http://www.ensm-douai.fr/
>
>
>
>
>
>
>
>
>
>
>
>
>
>


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