Re: [PATCH] rand.3: Clarify the lowest and highest return values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 12 Sep 2010, Michael Kerrisk wrote:

> Hi Mark,
> 
> On Sun, Sep 12, 2010 at 3:30 PM, Mark Hills <mark@xxxxxxxxxxx> wrote:
> > Commit 7155eb9 gives the range of return values, but the definition
> > of 'range' is unclear. Indicate clearly that RAND_MAX is included in
> > the set of possible return values.
[...]
> > -function returns a pseudo-random integer in
> > -the range [0,\ \fBRAND_MAX\fR].
> > +function returns a pseudo-random integer between 0
> > +and \fBRAND_MAX\fR (inclusive).
> >  .PP
> >  The
> >  .BR srand ()
> > --
> > 1.7.1
> 
> The "[x..y]" notation in mathematics is used to express an inclusive
> range, so I don't want to eliminate that notation. But I agree that
> not everyone may be aware of this deail. I made the change below.

The notation looks correct, 'closed interval' or 'inclusive interval' may 
be better terminology than 'range', but I'm no mathematician.

Nevertheless, your patch below seems fine and should clear up any 
misunderstanding.

[...]
> -the range [0,\ \fBRAND_MAX\fR].
> +the range 0 to
> +.BR RAND_MAX
> +inclusive (i.e., the mathematical range [0,\ \fBRAND_MAX\fR]).

-- 
Mark

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux