Skip to content

Commit

Permalink
* random.c: documentation fix. srand(0) initializes PRNG with '0',
Browse files Browse the repository at this point in the history
	  not with random_seed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Aug 22, 2007
1 parent 2019652 commit 83ef7ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Wed Aug 22 09:54:28 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>

* random.c: documentation fix. srand(0) initializes PRNG with '0',
not with random_seed.

Wed Aug 22 09:53:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>

* bcc32/{Makefile.sub,setup.mak}: remove surplus slash from srcdir.
Expand Down
5 changes: 3 additions & 2 deletions random.c
Expand Up @@ -310,8 +310,8 @@ random_seed()
* srand(number=0) => old_seed
*
* Seeds the pseudorandom number generator to the value of
* <i>number</i>.<code>to_i.abs</code>. If <i>number</i> is omitted
* or zero, seeds the generator using a combination of the time, the
* <i>number</i>.<code>to_i.abs</code>. If <i>number</i> is omitted,
* seeds the generator using a combination of the time, the
* process id, and a sequence number. (This is also the behavior if
* <code>Kernel::rand</code> is called without previously calling
* <code>srand</code>, but without the sequence.) By setting the seed
Expand Down Expand Up @@ -481,6 +481,7 @@ rb_f_rand(argc, argv, obj)
default:
vmax = rb_Integer(vmax);
if (TYPE(vmax) == T_BIGNUM) goto bignum;
/* fall through */
case T_FIXNUM:
max = FIX2LONG(vmax);
break;
Expand Down
2 changes: 1 addition & 1 deletion version.h
Expand Up @@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-08-22"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070822
#define RUBY_PATCHLEVEL 55
#define RUBY_PATCHLEVEL 56

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
Expand Down

0 comments on commit 83ef7ad

Please sign in to comment.