This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rand() man-page ambiguous or bug in glibc?


> > The man-page says:
> >        The rand() function returns a pseudo-random integer between 0
> >        and RAND_MAX.
> > "Between" says me that neither 0 or RAND_MAX should be returned but a
> > simple test-program tells me otherwise.
> >
> > #include <stdio.h>
> > #include <stdlib.h>
> > int main(int argc, char *argv[]){for(;;){long long int dummy=rand(); if
> > (dummy == 0 || dummy == RAND_MAX)printf("value is %d\n", dummy);} return
> > 0;}
> >
> > So what is it?
> 
> Folkert,
> I already responded to the earlier version of this report, and
> described to you the fix for the man page (the evidence of your
> program is correct; the man page was badly worded).  I'm not sure why
> you are sending this message again?!

I'm very sorry, I missed it! Mea culpa.


Folkert van Heusden

-- 
Multi tail barnamaj mowahib li mora9abat attasjilat wa nataij awamir
al 7asoub. damj, talwin, mora9abat attarchi7 wa ila akhirih.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]