Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Message-ID: <39637EFD.21FCAB9B@ece.gatech.edu>
Date: Wed, 05 Jul 2000 14:31:25 -0400
From: Charles Wilson <cwilson@ece.gatech.edu>
X-Mailer: Mozilla 4.73 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: saurabh deshpande <saurabhd@andrew.cmu.edu>
CC: cygwin@sourceware.cygnus.com
Subject: Re: Random no. problem
References: <734163336.962806837@HPMENT48.ME.CMU.EDU>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



saurabh deshpande wrote:
> 

> When compiled on Sun Solaris or SGI Irix 6.4 using gcc compier i get 16838.
> When compiled on Windows NT 4 using Cygnus gcc compiler i get 1103527590.
> Is there a way i can get the same random numbers on Windows NT 4 and
> Sun/SGI ?
> 

Not easily. You cannot depend on separate implementations of random
number generators to give the same results. The only way to get what you
seem to want (a repeatable pseudo-random sequence on multiple
architectures) is to roll your own random number generator routine, and
seed it with the same seed on each architecture. See (for instance)
"Numerical Recipes in C" or something similar, for relatively decent
RNGs. 

In any case, this is more of a cross-platform, C programming issue, and
not really a cygwin-specific issue, so you should probably find another
list to discuss this topic.

--Chuck

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

