From 6063ba187760a62f10a97ba9dd6ff5a93107bb51 Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Sun, 29 Apr 2001 17:53:48 -0400 Subject: [DOC PATCH bleadperl] Document generation of random integers Message-ID: <20010429215348.A3971@netaxs.com> p4raw-id: //depot/perl@9909 --- pod/perlfunc.pod | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pod/perlfunc.pod') diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 4e7f1a940e..b97c4a896e 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.) -- cgit v1.2.1