From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22128 invoked by alias); 6 Aug 2002 16:02:11 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 22098 invoked from network); 6 Aug 2002 16:02:10 -0000 Received: from unknown (HELO book.moene.indiv.nluug.nl) (195.109.255.217) by sources.redhat.com with SMTP; 6 Aug 2002 16:02:10 -0000 Received: from local ([127.0.0.1] helo=moene.indiv.nluug.nl) by book.moene.indiv.nluug.nl with esmtp (Exim 3.35 #1 (Debian)) id 17c64h-0006w8-00; Tue, 06 Aug 2002 17:16:43 +0200 Message-ID: <3D4FE85A.4020900@moene.indiv.nluug.nl> Date: Tue, 06 Aug 2002 09:02:00 -0000 From: Toon Moene Organization: Moene Computational Physics, Maartensdijk, The Netherlands User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020622 Debian/1.0.0-0.woody.1 MIME-Version: 1.0 To: Emil Block CC: gcc-help@gcc.gnu.org Subject: Re: Random Number Generator References: <3D4AB78B.B9163FC4@his.com> <3D4AE077.4FD313A2@moene.indiv.nluug.nl> <3D4AFB38.7916FFCD@his.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00040.txt.bz2 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)