mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
a954def1fb
commit
ec72030317
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Feb 3 10:25:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
|
* random.c: Document range argument for Kernel#rand.
|
||||||
|
[ruby-core:51794] [Bug #7770]
|
||||||
|
|
||||||
Sun Feb 3 10:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
Sun Feb 3 10:00:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
* numeric.c: Document Float constants [ruby-core:51484] [Bug #7709]
|
* numeric.c: Document Float constants [ruby-core:51484] [Bug #7709]
|
||||||
|
|
8
random.c
8
random.c
|
@ -1273,12 +1273,14 @@ random_equal(VALUE self, VALUE other)
|
||||||
*
|
*
|
||||||
* rand #=> 0.2725926052826416
|
* rand #=> 0.2725926052826416
|
||||||
*
|
*
|
||||||
* When <tt>max.abs</tt> is greater than or equal to 1, +rand+ returns a
|
* When +max.abs+ is greater than or equal to 1, +rand+ returns a pseudo-random
|
||||||
* pseudo-random integer greater than or equal to 0 and less than
|
* integer greater than or equal to 0 and less than +max.to_i.abs+.
|
||||||
* <tt>max.to_i.abs</tt>.
|
|
||||||
*
|
*
|
||||||
* rand(100) #=> 12
|
* 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
|
* Negative or floating point values for +max+ are allowed, but may give
|
||||||
* surprising results.
|
* surprising results.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue