Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=2xUbbZOAas4FpaG6xiM1iYicp5xNFyBo+3wrNT1dqRR+G1mnvoQy/pkSlZsBB5nZFzdqodyXendgZ6W5Vl/VtBscDHIw9SD0Ansfw8gRkvtGe2bRTTjEKijMSxygSmVGzsnE+wALmaG+OeVyWE5jVYp7jzyUSUI2Be/F1oJ9gsY= ; Message-ID: <20041112190357.86327.qmail@web52608.mail.yahoo.com> Date: Fri, 12 Nov 2004 11:03:57 -0800 (PST) From: Reply-To: meadmaker1066-cyg AT yahoo DOT com Subject: Re: drand48() (and erand48) returns only zeros - SOLVED To: cygwin AT cygwin DOT com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Thanks Igor, Dave and Teun! I was missing the call to srand48(0); that "unlocked" both drand48 and erand48. My code (at least the random number part) is now working. In case anyone else is trying to do something similar a working snippet is below. Thanks to everybody who took time to help! Robert #include #include using namespace std; int main(int argc,char* argv[]){ unsigned short FinishSeed[3]={1,2,3}; srand48(0); //Initializes seed AND multiplicand for (int i=0; i < 10; i++){ printf("%g %g \n",drand48(),erand48(FinishSeed)); } return 0; } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/