From: Walt Mankowski Date: Sun, 29 Apr 2001 21:53:48 +0000 (-0400) Subject: [DOC PATCH bleadperl] Document generation of random integers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6063ba187760a62f10a97ba9dd6ff5a93107bb51;p=p5sagit%2Fp5-mst-13.2.git [DOC PATCH bleadperl] Document generation of random integers Message-ID: <20010429215348.A3971@netaxs.com> p4raw-id: //depot/perl@9909 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 4e7f1a9..b97c4a8 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3509,6 +3509,13 @@ than the value of EXPR. (EXPR should be positive.) If EXPR is omitted, the value C<1> is used. Automatically calls C unless C has already been called. See also C. +Apply C to the value returned by C if you want random +integers instead of random fractional numbers. For example, + + int(rand(10)) + +returns a random integer between C<0> and C<9>, inclusive. + (Note: If your rand function consistently returns numbers that are too large or too small, then your version of Perl was probably compiled with the wrong number of RANDBITS.)