Sean M. Burke writes:
>At 13:35 2002-03-11 -0800, William R Ward wrote:
>>[EMAIL PROTECTED] (_brian_d_foy) writes:
>> > here's the patch.  if no one complains after a few days i'll commit it.
>>[...]
>> > +Use the following simple function.  It selects a random integer between
>> > +(and possibly including!) the two given integers, e.g.,
>> > +C<random_int_in(50,120)>
>>It might include the minimum, but not the maximum.  From perlfunc:
>>
>>        rand    Returns a random fractional number greater than or
>>                equal to "0" and less than the value of EXPR.
>>
>>If you integerize it and add an offset, it will never be equal to the
>>maximum, though it might be equal to the minimum...
>
>The source says:
>     return $min + int rand(1 + $max - $min);
>
>Doesn't that do what you said it should, the way it says it should?

Yes, I realized that after I posted.  See my followup.

-- 
William R Ward            [EMAIL PROTECTED]          http://www.wards.net/~bill/
-----------------------------------------------------------------------------
     If you're not part of the solution, you're part of the precipitate.

Reply via email to