diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-12-16 18:00:23 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-12-16 18:00:23 +0900 |
commit | cf54de637ce3747f9a761ca14edce7cf77f0e813 () | |
tree | 1f834d989b618983cdca1accce6704f96585d289 /random.c | |
parent | 5bf0060e0a506d8b7a85e0f63898cb1cc8d4dcba (diff) |
[DOC] random number by range
-rw-r--r-- | random.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1469,6 +1469,7 @@ static VALUE rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd); * call-seq: * prng.rand -> float * prng.rand(max) -> number * * When +max+ is an Integer, +rand+ returns a random integer greater than * or equal to zero and less than +max+. Unlike Kernel.rand, when +max+ @@ -1482,8 +1483,8 @@ static VALUE rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd); * * prng.rand(1.5) # => 1.4600282860034115 * - * When +max+ is a Range, +rand+ returns a random number where - * range.member?(number) == true. * * prng.rand(5..9) # => one of [5, 6, 7, 8, 9] * prng.rand(5...9) # => one of [5, 6, 7, 8] @@ -1644,6 +1645,9 @@ rb_f_rand(int argc, VALUE *argv, VALUE obj) * Random.rand -> float * Random.rand(max) -> number * Random.rand(range) -> number */ static VALUE |