Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Jude DaShiell , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: fighting djgpp libraries Date: Fri, 10 Apr 1998 18:49:54 -0700 Message-ID: <19980411014943.AAE28260@ppp127.cartsys.com> Precedence: bulk At 06:19 4/10/1998 -0400, Jude DaShiell wrote: >All I was trying to do was to use clock() to seed srandom() since >I think I've maybe figured out a technique for improving random number >generation for programmers using gcc at least. >One thing I noticed was that re-seeding of random number generators >happened very >predictibly in code I've read. I don't understand you here. Why should you want to seed a random number generator more than once, except to get a predictable sequence of values? You should seed it once, with something like the time (which, btw, `clock' does NOT give you). >I asked myself would any measureable effect come out of randomizing >re-seeding? This typically happens already. At least in the simple case of a LCRNG, calling `random' takes the seed value, does something random to it, returns it, and stores it back in the seed for the next time. A call to `srandom' will often `random' several times, to make the values a little less obviously related to the seed. >To that end I tried writing the following code. I think it's commented >pretty well. >Here's the source code below, I'd like to know how to resolve the >conflicts; [snipped] >#include >#include >#include >#include > >int >main(void) > double modf(double x, int *p); >clock_t >clock(void); >long >random(void); >{ Why on earth do you re-prototype these functions? They are already prototyped in the headers, and your redeclaration interferes, hence the errors. Nate Eldredge nate AT cartsys DOT com