NAME

rand - retrieve the next pseudorandom number


SYNOPSIS

rand EXPR

rand


DESCRIPTION

Returns a random fractional number between 0 and the value of EXPR. (EXPR should be positive.) If EXPR is omitted, returns a value between 0 and 1. Automatically calls srand unless srand has already been called. See also srand.

(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.)