Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <39639CEC.74C5EEDA@wanadoo.fr> Date: Wed, 05 Jul 2000 14:39:08 -0600 From: "Jerome G. Benoit" X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 CC: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Random no. problem References: <734163336 DOT 962806837 AT HPMENT48 DOT ME DOT CMU DOT EDU> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit You can find Pseudo Random Generator in GSL [the GNU Scientific Library] and some documentation as well. saurabh deshpande wrote: > > Hi! > > I have a C program which uses the standard library random no. generator > rand() and srand() for initialisation. The program gives consistent answer > when compiled using "gcc" on Sun Solaris or SGI Irix 6.4 . > When i run the code on Windows NT 4 using Cygnus gcc compiler , a different > set of random numbers are generated giving entirely different answer. > > Here is the code: > > #include > main(){ > > srand(1); > printf("%i",rand()); > > } > 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 ? > > thanks, > Saurabh > > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com