From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 500 invoked by alias); 2 Aug 2002 20:00:26 -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 326 invoked from network); 2 Aug 2002 20:00:23 -0000 Received: from unknown (HELO laptop.moene.indiv.nluug.nl) (195.109.255.217) by sources.redhat.com with SMTP; 2 Aug 2002 20:00:23 -0000 Received: from local ([127.0.0.1] helo=moene.indiv.nluug.nl) by laptop.moene.indiv.nluug.nl with esmtp (Exim 3.12 #1 (Debian)) id 17aiIx-000093-00; Fri, 02 Aug 2002 21:41:43 +0200 Message-ID: <3D4AE077.4FD313A2@moene.indiv.nluug.nl> Date: Fri, 02 Aug 2002 13:00:00 -0000 From: Toon Moene Organization: Moene Computational Physics, Maartensdijk, The Netherlands X-Accept-Language: en MIME-Version: 1.0 To: Emil Block CC: gcc-help@gcc.gnu.org Subject: Re: Random Number Generator References: <3D4AB78B.B9163FC4@his.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00014.txt.bz2 Emil Block wrote: > Does anyone know why a call to RAND with G77 returns a different value > than a call to RAND with F77 using the same seed? The computer is a SUN > Sparc with OS 2.7. The same code is compiled in one case with G77 and in > the other case with F77. > > G77 rand (iseed) returns 0.563463211 > F77 rand (iseed) returns 0.843506 > > where iseed = 1375. It would help if you could figure out how the Sun Fortran run time library does this. G77's actually does: srand(iseed); return rand(); -- 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)