[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01075] Re: rand() / drand48()

From: matz@... (Yukihiro Matsumoto)
Date: 2000-01-08 08:21:46 UTC
List: ruby-talk #1075
In message "[ruby-talk:01074] Re: rand() / drand48()"
    on 00/01/08, GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp> writes:

|Sorry for my unclear words.  I agree your patch now, but you should
|document the difference from the previous one.  For rand() family
|user, the current behavior is strange a little.

Modified like this:
   
  rand(max)

      Returns a random integer number greater than or equal to 0 and
      less than the value of max. (max should be positive.)
      Automatically calls srand unless srand() has already been
      called.

      If max is 0, rand returns a random float number greater than or
      equal to 0 and less than 1.

In This Thread