From: Thierry Chich <chich () cust ! univ-bpclermont ! fr>
To: tru64-unix-managers
Subject: SUMMARY: rand
Date: Fri, 18 May 2001 15:02:18 +0000 [thread overview]
Message-ID: <102653647621953.tru64-unix-managers.marc@archive.invalid> (raw)
Thank you to Stan Horwitz and <sysadmin@astro.su.se>.
I have been a little bit a newbie with this question, since the
answer is in the man page for rand.
static unsigned int next = 1;
int myrand(void)
{
next = next * 1103515245 + 12345;
return ( (next >>16) & RAND_MAX);
}
void mysrand (unsigned int seed)
{
next = seed
}
Regards,
Thierry Chich
reply other threads:[~2001-05-18 15:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox