diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-03 01:25:57 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-03 01:25:57 +0000 |
commit | ec720303179b9ddf0c4762d17ed34d22e9ad170e (patch) | |
tree | 1f2d5f92148abed62de4ea555aec14083d6f1828 /random.c | |
parent | a954def1fbc9630ebd6f9f31e6cb9cf4b3c36ba8 (diff) |
* random.c: Document range argument for Kernel#rand.
[ruby-core:51794] [Bug #7770]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1273,12 +1273,14 @@ random_equal(VALUE self, VALUE other) * * rand #=> 0.2725926052826416 * - * When <tt>max.abs</tt> is greater than or equal to 1, +rand+ returns a - * pseudo-random integer greater than or equal to 0 and less than - * <tt>max.to_i.abs</tt>. + * When +max.abs+ is greater than or equal to 1, +rand+ returns a pseudo-random + * integer greater than or equal to 0 and less than +max.to_i.abs+. * * rand(100) #=> 12 * + * When +max+ is a Range, +rand+ returns a random number where + * range.member?(number) == true. + * * Negative or floating point values for +max+ are allowed, but may give * surprising results. * |