From 83ef7ad2536caf511fdf30ff11e810309f0df02b Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 22 Aug 2007 00:54:43 +0000 Subject: [PATCH] * random.c: documentation fix. srand(0) initializes PRNG with '0', 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 --- ChangeLog | 5 +++++ random.c | 5 +++-- version.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f18ac85d8..7a9a6fa8fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 22 09:54:28 2007 NAKAMURA, Hiroshi + + * random.c: documentation fix. srand(0) initializes PRNG with '0', + not with random_seed. + Wed Aug 22 09:53:14 2007 Nobuyoshi Nakada * bcc32/{Makefile.sub,setup.mak}: remove surplus slash from srcdir. diff --git a/random.c b/random.c index 6fa4f2ec02..eb9803af07 100644 --- a/random.c +++ b/random.c @@ -310,8 +310,8 @@ random_seed() * srand(number=0) => old_seed * * Seeds the pseudorandom number generator to the value of - * number.to_i.abs. If number is omitted - * or zero, seeds the generator using a combination of the time, the + * number.to_i.abs. If number is omitted, + * seeds the generator using a combination of the time, the * process id, and a sequence number. (This is also the behavior if * Kernel::rand is called without previously calling * srand, but without the sequence.) By setting the seed @@ -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; diff --git a/version.h b/version.h index 238b3b3de8..83a6321b61 100644 --- a/version.h +++ b/version.h @@ -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