From: Toon Moene <toon@moene.indiv.nluug.nl>
To: Emil Block <blime@his.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Random Number Generator
Date: Tue, 06 Aug 2002 09:02:00 -0000 [thread overview]
Message-ID: <3D4FE85A.4020900@moene.indiv.nluug.nl> (raw)
In-Reply-To: <3D4AFB38.7916FFCD@his.com>
Emil Block wrote:
> Toon Moene wrote:
>>G77's actually does:
>>
>>srand(iseed);
>>return rand();
> i = irand( k )
> r = rand( k )
> d = drand( k )
>
> k INTEGER*4 Input
> k=0: Get next random number in the sequence
> k=1: Restart sequence, return first number
> k>0: Use as a seed for new sequence, return first number
>
> rand REAL*4 Output
> drand REAL*8 Output
> irand INTEGER*4 Output
>
> No mention of srand but the funtion exists as well as srandom.
>
> Is G77 (rand_.c and srand_.c) doing an additional draw?
Sorry for answering this so late ...
From your description of whan Sun does, I'd say they do the same. They
must use *some* function to restart the sequence, and one would hope
that it were srand.
However, given the current evidence, it's hard to say. Perhaps you
could ask Sun ?
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
prev parent reply other threads:[~2002-08-06 16:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-02 9:48 Emil Block
2002-08-02 13:00 ` Toon Moene
2002-08-02 14:37 ` Emil Block
2002-08-06 9:02 ` Toon Moene [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D4FE85A.4020900@moene.indiv.nluug.nl \
--to=toon@moene.indiv.nluug.nl \
--cc=blime@his.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).