Re: Positive random number



pete said:

Johannes Bauer wrote:

Keith Thompson schrieb:
Jack Klein <jackklein@xxxxxxxxxxx> writes:
On Tue, 18 Dec 2007 00:43:10 -0800 (PST), deepak
<deepakpjose@xxxxxxxxx> wrote in comp.lang.c:
Can someone give the standard function which can create positive
integer value in C?
Other's have talked about "rand()",
but I don't see anything in your
post that requires it.
[...]

The subject was "Positive random number". That information should
have been in the body of the original post.

Th return value of rand isn't guaranteed to be positive.

Nor is it guaranteed to be random.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: Positive random number
    ... Johannes Bauer wrote: ... Keith Thompson schrieb: ... The subject was "Positive random number". ...
    (comp.lang.c)
  • Re: Positive random number
    ... Keith Thompson schrieb: ... The subject was "Positive random number". ... "Viele der Theorien der Mathematiker sind falsch und klar ... Ich vermute, ...
    (comp.lang.c)
  • Re: Positive random number
    ... pete wrote: ... The subject was "Positive random number". ... Th return value of rand isn't guaranteed to be positive. ... range of 0 to RAND_MAX (as defined by the header file ). ...
    (comp.lang.c)