Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Multi-channel rand() Date: Wed, 26 Dec 2018 19:34:36 -0800 Organization: None to speak of Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="32ed57ea5d614545634ff390fd99b31b"; logging-data="8710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZgUG8+zdWo5eESVSgUr/N" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:d0S54RM3658nRh8niQOioMLsE8M= sha1:NY/0ARTZdTk2L6VDhl5ed93O4Pg= Xref: csiph.com comp.lang.c:139115 comp.lang.c++:62535 rbowman writes: > On 12/26/2018 08:48 AM, Bart wrote: >> This doesn't seem too hard, but it's obviously not in the standard >> library (which AFAIK only has rand()). Example: > > Seems to be in mine... > > > RANDOM(3) Linux Programmer's Manual RANDOM(3) > > NAME > random, srandom, initstate, setstate - random number generator > > SYNOPSIS > #include > > long int random(void); > > void srandom(unsigned int seed); Scroll down, and you'll see this: CONFORMING TO POSIX.1-2001, POSIX.1-2008, 4.3BS It's defined by POSIX, but not by ISO C (which is what Bart presumably meant by "standard library"). -- Keith Thompson (The_Other_Keith) kst@mib.org Will write code for food. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"