| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com> |
| List-Archive: | <http://sourceware.cygnus.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT sourceware DOT cygnus DOT com> |
| List-Help: | <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs> |
| Sender: | cygwin-owner AT sourceware DOT cygnus DOT com |
| Delivered-To: | mailing list cygwin AT sourceware DOT cygnus DOT com |
| Date: | Wed, 05 Jul 2000 14:20:37 -0400 |
| From: | saurabh deshpande <saurabhd AT andrew DOT cmu DOT edu> |
| To: | cygwin AT sourceware DOT cygnus DOT com |
| cc: | saurabhd AT andrew DOT cmu DOT edu |
| Subject: | Random no. problem |
| Message-ID: | <734163336.962806837@HPMENT48.ME.CMU.EDU> |
| Originator-Info: | login-token=Mulberry:01ctFtyeUy4julPuRBhELoNwxApPL0O/XXSJsssVGqQqhU; |
| token_authority=postmaster AT andrew DOT cmu DOT edu | |
| X-Mailer: | Mulberry (Win32) [1.4.4, s/n S-100002] |
| MIME-Version: | 1.0 |
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 <stdlib.h>
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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |