[前][次][番号順一覧][スレッド一覧]

ruby-changes:23342

From: drbrain <ko1@a...>
Date: Thu, 19 Apr 2012 09:35:48 +0900 (JST)
Subject: [ruby-changes:23342] drbrain:r35393 (trunk): * random.c (random_init): Clarify that the default seed is

drbrain	2012-04-19 09:35:32 +0900 (Thu, 19 Apr 2012)

  New Revision: 35393

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35393

  Log:
    * random.c (random_init):  Clarify that the default seed is
      Random.new_seed, not zero.  Based on patch by Roger Pack.
      [ruby-trunk - Bug #6313]
    * random.c (rb_f_srand):  ditto.

  Modified files:
    trunk/ChangeLog
    trunk/random.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35392)
+++ ChangeLog	(revision 35393)
@@ -1,3 +1,10 @@
+Thu Apr 19 09:35:15 2012  Eric Hodel  <drbrain@s...>
+
+	* random.c (random_init):  Clarify that the default seed is
+	  Random.new_seed, not zero.  Based on patch by Roger Pack.
+	  [ruby-trunk - Bug #6313]
+	* random.c (rb_f_srand):  ditto.
+
 Thu Apr 19 08:59:02 2012  Eric Hodel  <drbrain@s...>
 
 	* ext/curses/curses.c (window_nodelay):  Fixed call-seq of nodelay to
Index: random.c
===================================================================
--- random.c	(revision 35392)
+++ random.c	(revision 35393)
@@ -448,8 +448,7 @@
 
 /*
  * call-seq:
- *   Random.new()     -> prng
- *   Random.new(seed) -> prng
+ *   Random.new(seed = Random.new_seed) -> prng
  *
  * Creates a new PRNG using +seed+ to set the initial state. If +seed+ is
  * omitted, the generator is initialized with Random.new_seed.
@@ -762,7 +761,7 @@
 
 /*
  * call-seq:
- *   srand(number=0)    -> old_seed
+ *   srand(number = Random.new_seed) -> old_seed
  *
  * Seeds the system pseudo-random number generator, Random::DEFAULT, with
  * +number+.  The previous seed value is returned.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]